Excel Count Dates Before Today: Step-by-Step Guide
In this article
To count dates before today in Excel, use the COUNTIF function with a dynamic criteria: =COUNTIF(A2:A100,"<"&TODAY()). This counts every cell in the range that holds a date earlier than the current date. The TODAY() function updates automatically each day, so the count stays current without editing the formula. This works in Excel for Microsoft 365, Excel 2019, 2021, and Excel for Mac. The steps below assume your dates are in a single column and are stored as real Excel dates, not text.
What You'll Need
- A version of Excel that supports COUNTIF and TODAY (all modern desktop and web versions do).
- Dates entered in a single column, ideally with a header row.
- Dates stored as actual date values, not plain text. If a date is left-aligned in the cell, it is likely text and COUNTIF will not count it correctly.
Step-by-Step
- Select a blank cell where you want the result to appear, for example cell C1.
- Type the formula:
=COUNTIF(A2:A100,"<"&TODAY()). ReplaceA2:A100with the actual range that holds your dates. Keep the quotation marks around<and the ampersand before TODAY(). - Press Enter. The cell now shows the number of dates in that range that fall before today's date.
- Verify the range. Click the cell with the result and check the formula bar to confirm the range matches your data. If your dates run to row 500, use A2:A500.
- Format the result as a number if Excel shows a date instead. Select the result cell, then use Home > Number Format and choose Number or General. This happens when the cell inherited date formatting from nearby cells.
- Test with a known date. Temporarily change one date in the range to yesterday's date and confirm the count increases by one. Undo the change afterward.
- Copy the formula to other cells if you need counts for multiple columns or sheets. Use relative references for the range and keep TODAY() as is.
If you also want to count dates that are today or in the future, use separate formulas: =COUNTIF(A2:A100,TODAY()) for today only, and =COUNTIF(A2:A100,">"&TODAY()) for future dates. To count dates before a fixed date rather than today, replace TODAY() with a date in quotes, such as "<"&DATE(2024,1,1) or simply "<1/1/2024". The TODAY() version is the one that stays accurate over time.
Common Mistakes
- Using the wrong comparison operator.
"<"&TODAY()counts dates strictly before today. If you want to include today, use"<="&TODAY(). Mixing up < and <= is the most frequent cause of an off-by-one count. - Forgetting the ampersand. Writing
"<TODAY()"treats the whole thing as text and returns 0. The criteria must concatenate the operator with the function result. - Dates stored as text. If dates were imported or typed with an apostrophe, COUNTIF may ignore them. Check alignment: real dates are right-aligned by default. Convert text dates with Data > Text to Columns or by using DATEVALUE.
- Including the header row. If row 1 contains the word "Date", including it in the range does not usually break the count, but it can if the header looks like a date. Start the range at the first data row.
- Using a fixed date instead of TODAY(). A formula like
=COUNTIF(A2:A100,"<1/1/2024")stops being accurate once the date passes. Use TODAY() for a rolling count. - Result cell formatted as a date. The count may display as a date serial number. Change the number format to General or Number.
Tips
- Use a named range or an Excel Table so the formula expands automatically when you add new dates. With a table named Dates, the formula becomes .
- Combine with other criteria using COUNTIFS. For example,
=COUNTIFS(A2:A100,"<"&TODAY(),B2:B100,"Open")counts past-due items that are still open. - To highlight dates before today, use Conditional Formatting with the formula
=A2<TODAY()applied to the date column. - Press F9 to recalculate if the count seems stale. TODAY() updates on recalculation, which normally happens when the workbook opens or a cell changes.
- Keep a helper cell with
=TODAY()if you want to see the reference date the count is using, especially when sharing the file with others in different time zones.
Troubleshooting
If the formula returns 0 when you know there are past dates, first check whether the dates are real date values. Select a date cell and look at the formula bar: a real date shows as a date, while text may show an apostrophe or a different format. Use Data > Text to Columns and choose the date format to convert text dates. Next, confirm the range is correct and does not point to an empty column. Check that the comparison operator matches your intent: < excludes today, <= includes it. If you see a #VALUE! error, a quotation mark or ampersand is likely missing. If the result looks like a date such as 45000, change the cell format to Number. If the count changes unexpectedly after opening the file, remember that TODAY() recalculates and the count will naturally increase as days pass. For shared workbooks, confirm everyone is using the same date system (1900 vs 1904) under File > Options > Advanced, as this can shift date values.
Frequently Asked Questions
Why does my COUNTIF formula return 0?
The most common reasons are dates stored as text, a missing ampersand in the criteria, or a range that does not include the data. Check each of these in that order.
How do I count dates before today but after a certain date?
Use COUNTIFS with two criteria: =COUNTIFS(A2:A100,"<"&TODAY(),A2:A100,">"&DATE(2024,1,1)). Adjust the second date as needed.
Does TODAY() update automatically?
Yes. TODAY() returns the current date each time the workbook recalculates, so the count stays current without editing the formula.
Can I count dates before today across multiple sheets?
Yes, but COUNTIF does not accept 3D references directly. Either create a summary formula that adds counts from each sheet, or consolidate the dates into one sheet or table first.
What is the difference between < and <= in the criteria?
< counts dates strictly earlier than today. <= also includes today's date. Choose based on whether today should be counted as past due.
Why does the result show as a date like 45000?
The result cell inherited date formatting. Select it and change the number format to General or Number to see the count.