How to compare two dates and flag late deliveries in Excel
Formula (Excel and Google Sheets)
=IF(C2="","Not delivered",IF(C2>B2,"Late","On time"))Check for a missing date first, then compare: =IF(C2="","Not delivered",IF(C2>B2,"Late","On time")).
- Result on the example
- one result per row in
D2, filled down toD7 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in D2, filled down to D7. Change any input and the result updates, or edit the formula to experiment.
How it works
The first IF catches the empty delivery date. An empty cell counts as 0, which is earlier than any date, so without this test PO-775 would show "On time". The second IF compares the two dates: a later date is a larger number. Delivery on the promised day counts as on time.
=IF(C2="","Not delivered",IF(C2>B2,"Late","On time"))Result"On time"
C29/3/2026The value in C2.
C2=""FALSEThe = operator tests whether the two sides are equal.
B29/4/2026The value in B2.
C2>B2FALSEThe > operator tests greater than.
IF(C2>B2,"Late","On time")"On time"IF: Returns one value if a test is true, another if false.- logical_test
C2>B2FALSE - value_if_true
"Late"not used - value_if_false
"On time"
- logical_test
IF(C2="","Not delivered",IF(C2>B2,"Late","On time"))"On time"IF: Returns one value if a test is true, another if false.- logical_test
C2=""FALSE - value_if_true
"Not delivered"not used - value_if_false
IF(C2>B2,"Late","On time")"On time"
- logical_test
In Google Sheets
The same formula works in Google Sheets: =IF(C2="","Not delivered",IF(C2>B2,"Late","On time")). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =IF(C2="","Not delivered",IF(C2-B2>0,C2-B2&" days late","On time")) | On time, 4 days late, On time…Different result | Says how late, by subtracting the dates. Shows "4 days late" and "7 days late" instead of "Late". |
| =IFS(C2="","Not delivered",C2>B2,"Late",TRUE,"On time") | On time, Late, On time… | IFS lists the cases in order without nesting. Excel 2019 and later, and Google Sheets. |
Common mistakes
- Skipping the blank check marks undelivered orders as on time.
- Dates with times attached make a same-day delivery at 3 PM "later" than a promised date at midnight. Compare
INT(C2)when times are present.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Compare two dates and flag late deliveries
D2, show "Not delivered" when there is no delivery date, "Late" when it is after the promised date, and "On time" otherwise. Fill down to D7.Questions
How do I calculate days late, with 0 for early deliveries?
Use MAX: =IF(C2="","",MAX(0,C2-B2)).
How do I count late deliveries?
Compare the columns row by row: =SUMPRODUCT((C2:C7<>"")*(C2:C7>B2:B7)).
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.