Determining the First Date with No Transactions

Written by Allen Wyatt (last updated May 16, 2026)

1

Mary has a worksheet that contains transactions from the company accounting system. The worksheet is sorted by column A, which contains the transaction dates. Mary wonders if there is a formula that will let her know the first date in column A for which there is not at least one transaction.

Mary's question is a bit ambiguous, as she doesn't make it clear what constitutes "no transaction" for a date. It could mean that Mary is looking for the first date that is skipped in column A ("no transaction" means no row at all) or the first date for which there is nothing in a corresponding transaction column ("no transaction" means nothing in, say, column B for the date in column A).

Let's look at the first possibility, in which Mary needs to know the first skipped date in column A. I'm going to assume in all of these formulas that the dates are in the range A2:A1000. The following formula looks at the dates and compares them to the dates in the cells offset by one row. If the difference is greater than 1, then that is the date that is returned by the formula:

=INDEX(1 + A2:A999, MATCH(1, --(A3:A1000 > 1 + A2:A999), 0))

The output of this formula, as is the case with all formula results in this tip, needs to be formatted as a date to be meaningful. If you are using Excel 2021 or later, then the following version can be used. The benefit is that it returns "Not Found" if there are no gaps in the dates.

=LET(x, 1 + A2:A999, XLOOKUP(1, --(A3:A1000 > x), x, "Not Found"))

You could also use the following formula if you are using Excel 2024 or later:

=LET(x,A2:A1000,1+@FILTER(DROP(x,-1),DROP(x,1)-DROP(x,-1)>1))

If you use this formula, you may get a warning from Excel suggesting that you move the @ sign to before LET instead of the position shown. The supposed reason for this is for compatibility with older versions of the program. However, FILTER and LET require Excel 2021 or later and DROP requires Excel 2024 or later, thus compatibility with older versions is a moot point.

If Mary wanted to find all the dates missing from column A, then this formula will do the trick nicely:

=LET(Transdates,A2:A1000, Mindate,  MIN(Transdates), Maxdate,  MAX(Transdates), Alldates, SEQUENCE(Maxdate-Mindate+1,,Mindate,1), UNIQUE(VSTACK(Transdates, Alldates),,TRUE))

The formula will spill however many dates are missing from column A between the earliest date and the latest date in the column. Since column A is already in ascending order, the dates produced by the formula will also be in ascending order.

The second possibility for Mary's data is that every date appears at least once in column A, and "no transaction" is determined by a value missing in column B. The need would be to return the first date with a blank value in column B. If this is the case, then the following is probably the easiest formula to return the date:

=INDEX(A2:A1000,MATCH(TRUE,(B2:B1000="")+(B2:B1000=0)>0,))

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13984) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Positive and Negative Colors in a Chart

When creating a line cart, the line can show values both positive and negative values. This tip explains how you can use ...

Discover More

Changing Body Text to a Heading

When working on a document in Outline view, you may need to change regular body text to a heading in the outline. It's ...

Discover More

An Easy Way to Count Items

Need to quickly count a group of items in a document? Here's a drop-dead easy way to get that count.

Discover More

Best-Selling VBA Tutorial for Beginners Take your Excel knowledge to the next level. With a little background in VBA programming, you can go well beyond basic spreadsheets and functions. Use macros to reduce errors, save time, and integrate with other Microsoft applications. Fully updated for the latest version of Office 365. Check out Microsoft 365 Excel VBA Programming For Dummies today!

More ExcelTips (ribbon)

Returning Least-Significant Digits

Do you ever have a need to return just a few digits out of a number? This tip shows different formulas you can use to ...

Discover More

Finding the Directory Name

Need to know the directory (folder) in which a workbook was saved? You can create a formula that will return this ...

Discover More

Returning the Rightmost Value in a Row

Do you need to figure out the rightmost value within a row in which not all cells may contain values? This tip provides a ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is eight more than 9?

2026-05-16 14:22:30

J. Woolley

Re. the Tip's "first possibility," Mary's company might not expect transactions on weekends or holidays. In this case she could put a list of holiday dates in H2:H12 and modify the Tip's first two formulas like this:
=INDEX(1 + A2:A999, MATCH(1, --(A3:A1000 > 1 + A2:A999) * NETWORKDAYS(1 + A2:A999, 1 + A2:A999, H2:H12), 0))
=LET(x, 1 + A2:A999, XLOOKUP(1, --(A3:A1000 > x) *
NETWORKDAYS(x, x, H2:H12), x, "Not Found"))
The holiday list H2:H12 is optional; if it is missing or empty, then only weekends are ignored.
Re. the Tip's "second possibility," here are two alternative versions of its last formula:
=INDEX(A2:A1000, MATCH(1, --(B2:B1000 = 0), 0))
=XLOOKUP(1, --(B2:B1000 = 0), A2:A1000, "Not Found")
To ignore weekends and holidays, replace --(B2:B1000 = 0) in each formula with the following:
--(B2:B1000 = 0) * NETWORKDAYS(--A2:A1000, --A2:A1000, H2:H12), 0))
Notice NETWORKDAYS will not return an array if either of the first two arguments is simply a range; they are converted to an array by creating an expression (double unary in this case).


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.