If A2 contains a due date and B2 contains the date you want to check, enter =IF(A2<B2,"Overdue","Not overdue") to label dates before the check date as overdue. Excel stores genuine dates as numbers, so IF can compare them directly. The same method works for deadlines, start dates, review dates, and other date-based checks.
What You’ll Need
- A Microsoft Excel workbook in Excel for Microsoft 365 on Windows. The basic IF formulas also work in Excel for Mac and Excel for the web.
- Cells containing actual Excel dates, not date-looking text. For the main example, put a due date in A2 and a check date in B2.
- A clear rule for what should happen on the exact date. Decide whether a date equal to the cutoff belongs in the first or second result.
Step-by-Step
- Set up the dates. In a blank worksheet, enter a heading such as Due date in A1 and Check date in B1. Enter a sample due date, such as October 20, 2026, in A2, and a check date, such as November 3, 2026, in B2. You can enter dates in the format your Excel regional settings recognize, then display them consistently. To format the cells on Windows, select them and choose Home > Number Format, then select Short Date or Long Date. You can also press Ctrl+1 to open Format Cells. On Mac, select the cells and use Format Cells from the Format menu, or press Command+1 in versions that support that shortcut. The displayed date style does not change the underlying date value.
- Choose the condition and outcomes. Decide what comparison should trigger the first result. For example, a due date earlier than the check date is overdue; a due date equal to or later than the check date is not overdue. In an IF statement, the first part is a test that evaluates to TRUE or FALSE. The second part is returned when the test is TRUE, and the third part is returned when it is FALSE. Text results need straight double quotation marks. Cell references such as A2 and B2 do not.
- Enter the IF formula in the result cell. With the due date in A2 and check date in B2, put this formula in C2:
=IF(A2<B2,"Overdue","Not overdue"). Excel checks whether A2 is earlier than B2. With the example dates above, the test is TRUE, so C2 displays Overdue. If the due date is November 3, 2026, the test is FALSE and Excel displays Not overdue, because the formula uses < rather than <=. - Choose whether the cutoff date counts as overdue. If an item should count as overdue on its due date, use a less-than-or-equal comparison instead. With the due date in A2 and check date in B2, use this in C2:
=IF(A2<=B2,"Overdue","Not overdue"). With both dates set to November 3, 2026, this formula returns Overdue. Use < when the item becomes overdue only after the due date has passed; use <= when it becomes overdue on the due date itself. - Copy the formula down the column. If each row has its own due date in column A and check date in column B, select C2 and drag the fill handle, the small square at the lower-right corner of the selected cell, down the rows. You can also copy C2, select the destination cells, and paste. Excel adjusts the relative references automatically: the next row will compare A3 with B3. Check the last few results to confirm the formulas refer to the intended row.
- Use a fixed cutoff date when appropriate. If you are classifying dates against a specific calendar date rather than a date in another cell, use DATE to build the comparison date. With the date being checked in A2, enter this formula in B2:
=IF(A2>=DATE(2026,1,1),"2026 or later","Before 2026"). For a date of January 1, 2026, or later, the formula returns 2026 or later. DATE(year,month,day) avoids ambiguity between regional date formats, and its month and day arguments are numbers without quotation marks. Change the year, month, or day to set a different threshold. - Test the boundary cases. Try one date before the cutoff, one equal to it, and one after it. This confirms that you chose the correct comparison operator and that the result labels match your policy. When the dates are in separate cells, temporarily change the check date in B2 and see whether the label in C2 updates. Restore the intended date after checking.
Common Mistakes
- Entering a date as text. A value such as an apostrophe followed by a date, or a date imported as text, may look correct but not compare as expected. Click the cell and check whether Excel recognizes its value as a date. Changing the number format alone does not convert text into a real date.
- Choosing the wrong comparison operator. < excludes dates equal to the cutoff, while <= includes them. The same distinction applies to > and >=. Be explicit about whether the cutoff day should count as meeting the rule.
- Putting quotation marks around a cell reference. In a test, A2 refers to the date in the cell, while “A2” is literal text. Use quotation marks for text labels such as “Overdue”, not for references or dates stored in cells.
- Using a regional date string inside a formula. Typing a date as text in a formula can be interpreted differently across regional settings. A cell containing a real date or the DATE function is safer for a fixed cutoff.
- Comparing dates that include times. Excel dates can include a time fraction. Two cells may display the same day while one contains a time, so an exact equality test may return FALSE. Consider whether the time is meaningful before using an equality comparison.
Tips
- Use TODAY for a moving check date. If the rule should update based on the current date, use TODAY rather than typing a check date that will become stale. With a due date in A2, this formula returns Overdue only when the due date is earlier than today:
=IF(A2<TODAY(),"Overdue","Not overdue"). TODAY updates when Excel recalculates the workbook, so the result can change from one day to the next. For a rule that counts the due date itself, replace < with <=. - Return a blank for empty rows. Without a blank check, an empty date cell can produce a misleading result because Excel treats a blank as a value in comparisons. With a due date in A2, use this formula in the result cell:
=IF(A2="","",IF(A2<TODAY(),"Overdue","Not overdue")). It leaves the result empty when A2 is empty, then checks the date when A2 has a value. - Check the cell format when a result looks like a number. A formula that returns a date or number may display as a serial number if the result cell has General formatting. Select the result cell and choose an appropriate format from Home > Number Format. For text labels such as Overdue, the result should display as text.
- Keep the rule easy to audit. For a cutoff that people may need to change, put the cutoff in a clearly labeled cell instead of embedding a fixed date in every formula. That makes it easier to review the rule and change the cutoff once. Keep the comparison operator and the label text consistent across the whole result column.
Troubleshooting
The formula displays instead of a result. Check that the cell is not formatted as Text. Change it to General, then re-enter the formula by clicking the formula bar and pressing Enter. Also check that the formula begins with an equals sign and that Show Formulas is not turned on. In Excel for Windows, Ctrl+` toggles formula display; on Mac, the shortcut can vary by keyboard layout, so check the Formulas tab for the Show Formulas control.
The formula returns the wrong label for dates that look right. Test the date cells individually: select each one and change its format to General. A real Excel date will normally display as a number, while text may remain text. If the data came from a CSV or another system, use Text to Columns or a careful conversion method to turn text into dates, then verify a few converted values. Be cautious with dates such as 03/04/2026, which can mean different days in different regions.
Excel reports a formula problem. Check the commas, parentheses, and quotation marks. Excel formulas normally use commas between arguments, but some regional settings require semicolons; if Excel rejects a correctly structured formula, replace argument-separating commas with the separator used by your installation. Use straight quotation marks, not curly typographic quotes. If the result cell is part of a table, confirm that the formula has filled into the intended rows.
A date equal to the cutoff gets the unexpected result. Review whether the formula uses <, <=, >, or >=. These operators intentionally treat equality differently. If the dates appear equal but behave differently, check for hidden time values by increasing the displayed decimal precision or examining the formula bar, and decide whether to remove or account for the time.
Frequently Asked Questions
Can IF compare dates directly in Excel?
Yes. Excel stores real dates as serial numbers, so comparisons such as earlier than, later than, or equal to work directly. Make sure the cells contain dates Excel recognizes, rather than text that only looks like a date.
How do I check whether a date falls before a deadline?
Put the date and deadline in separate cells and compare them with <. Use <= if a date on the deadline should also qualify. Put the desired true and false labels in quotation marks, then test a date before, on, and after the deadline.
How do I use IF to show whether a date is overdue?
Compare the due date with TODAY for a check that updates over time. Use < if an item is overdue only after its due date, or <= if it is overdue on that date. Add a blank-cell check when the due-date column contains empty rows.
Can I compare a date with a date typed directly into the formula?
You can, but a date written as text can be misread under different regional settings. For a fixed date, DATE(year,month,day) is a dependable option; for a cutoff that may change, use a cell containing a real date instead.
Why does an IF formula treat two dates on the same day as different?
One cell may include a time value that is not visible in its date format. For example, a date at midnight and the same date at 3:00 p.m. are different stored values. If time should not matter, remove the time from the source data or adapt the comparison to check whole calendar days.
Will these date IF formulas work on Mac or in Excel for the web?
Yes. Basic IF, TODAY, and DATE formulas work in current Excel for Mac and Excel for the web as well as Excel for Microsoft 365 on Windows. Ribbon labels and keyboard shortcuts can differ slightly, but the formula logic is the same. If your regional settings use semicolons between function arguments, use those separators when entering a formula.
Related
- Delete Blank Rows in Excel Quickly: Safe Ways to Clean
- How to Delete Blank Cells in Excel Without Losing Data
- How to Delete an Excel File from a SharePoint Site
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- XLOOKUP Excel Conditional Search: Formulas and ExamplesTo use XLOOKUP for a conditional search in Excel, put the condition in its lookup array; for multiple…
- How to Filter Multiple Dates in Excel by Range or ListTo filter multiple dates in Excel, turn on the column filters, open the arrow on your date column,…
- Excel Accounting Shortcuts: Formulas, Keys, and TipsExcel accounting shortcuts are a mix of keyboard commands and formulas: use Alt+= to insert an AutoSum, Ctrl+T…
- ROUNDUP Excel Cell Reference: 10 Useful Formula PatternsWith 12.31 in A2, enter =ROUNDUP(A2,0) to return 13; the formula reads the number from a cell and…
- Excel RIGHT, LEFT, and MID Formulas: Syntax and ExamplesIn Excel, RIGHT extracts characters from the end of text, LEFT extracts them from the beginning, and MID…
- Excel CONCAT Examples: Formulas for Joining TextTo join a first name in A2 and a surname in B2 with a space between them, enter…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.