Determining the First Date with No Transactions

Written by Allen Wyatt (last updated May 16, 2026)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365


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

Stepping Through a Macro with a Worksheet Visible

When developing a macro, it is often necessary to step through the various code lines so you can see what is happening on ...

Discover More

Using Multiple Print Settings

Do you have a worksheet from which you need to print only portions of the data available? There are two ways you can ...

Discover More

Determining If a Number is Odd or Even

If you need to know whether a particular value is odd or even, you can use this simple formula. Designed to be used in a ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 365 applications with VBA programming. Written in clear terms and understandable language, the book includes systematic tutorials and contains both intermediate and advanced content for experienced VB developers. Designed to be comprehensive, the book addresses not just one Office application, but the entire Office suite. Check out Mastering VBA for Microsoft Office 365 today!

More ExcelTips (ribbon)

Projects in Process for Each Day in a Range of Dates

If you use Excel to track projects on which you are working, you may want to determine how many projects were in-process ...

Discover More

Cell and Name References in COUNTIF

The second parameter of the COUNTIF function is used to specify the criteria to be used when determining what should be ...

Discover More

Checking for Duplicate Rows Based on a Range of Columns

When working with data in Excel, you might want to figure out which rows of data represent duplicates of other rows. If ...

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 four less than 4?

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.