Auditing: Flag Ship Dates Before The Order Date Or Shipped Late

Excel Formulas › Auditing & Error-Proofing

All versions

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.


Quick formula: Check the impossible case first:
=C2-B2

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.

Functions used (tap for the full reference guide):

The example

Three worked examples. Change any yellow input in the practice workbook and the results recalculate.

ABCDEF
1CaseOrder dateShip dateMax daysDays to shipFlag
2SO-101Mon 11/2/2026Fri 11/6/202634Late
3SO-102Tue 11/3/2026Sun 11/1/20263-2Before order
4SO-103Wed 11/4/2026Thu 11/5/202631OK

The formula

Here is the formula, built directly from the inputs:

=C2-B2 // Days to ship; Flag

How it works

Here is the logic, one piece at a time:

  1. C2-B2 is the number of days from order to shipment.
  2. C2<B2 catches ship dates entered before the order.
  3. E2>D2 catches shipments outside the window.
  4. Everything else returns OK.

Keep every number in its own input cell so the formula never needs editing.

Try it: interactive demo

Interactive

Enter the values below.

Variations

Business days

Count only workdays.

=NETWORKDAYS(B2,C2)-1

Count late orders

Summary for a report.

=COUNTIF(F2:F500,"Late")

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?
A negative gap would otherwise slip through as OK.
Can I use business days?
Yes, swap the subtraction for NETWORKDAYS.

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

Related formulas: Reconcile Two Lists (Find Mismatches) · Cross-Foot Check (Totals Tie) · Flag Out-of-Range Values

Function references: IF