A shipment dated before its order is a data-entry error, and one that took longer than your promised window is a service problem. Subtracting the dates gives days to ship, and a nested IF checks the impossible case first, then the late case, and marks everything else OK.
Order SO-101 placed on 11/2/2026 and shipped on 11/6/2026 took 4 days, so against a 3-day window it is flagged Late.
The example
Three worked examples. Change any yellow input in the practice workbook and the results recalculate.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Case | Order date | Ship date | Max days | Days to ship | Flag |
| 2 | SO-101 | Mon 11/2/2026 | Fri 11/6/2026 | 3 | 4 | Late |
| 3 | SO-102 | Tue 11/3/2026 | Sun 11/1/2026 | 3 | -2 | Before order |
| 4 | SO-103 | Wed 11/4/2026 | Thu 11/5/2026 | 3 | 1 | OK |
The formula
Here is the formula, built directly from the inputs:
How it works
Here is the logic, one piece at a time:
C2-B2is the number of days from order to shipment.C2<B2catches ship dates entered before the order.E2>D2catches shipments outside the window.- Everything else returns
OK.
Keep every number in its own input cell so the formula never needs editing.
Try it: interactive demo
Enter the values below.
Variations
Business days
Count only workdays.
Count late orders
Summary for a report.
Pitfalls & errors
Blank ship dates read as day zero and flag as Before order; filter open orders first.
Dates stored as text will not subtract; convert them to real dates.
Add conditional formatting so Late and Before order rows stand out.
Practice workbook
Frequently asked questions
Why check Before order first?
Can I use business days?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class