Calculate the Days Between Two Dates
You have two date columns — order date and delivery date, invoice sent and invoice paid — and need the number of days between them for every row.
Excel & Google Sheets
This formula works in both Excel and Google Sheets.
How it works
Spreadsheets store every date as a serial number counting days since a fixed start point, so subtracting two dates gives the whole days between them — no function needed. An order placed 10 June and delivered 8 July is simply 28. The result excludes the start date and includes the end date, which is what most people expect for elapsed time. If you prefer an explicit function, =DATEDIF(A2,B2,"D") returns the identical day count and reads more clearly in an audit. Just keep the earlier date in A2: subtracting the wrong way round gives a negative number, and DATEDIF with reversed dates errors with #NUM!.
When to use it
Use it for order-to-delivery time, days from invoice to payment, project duration, or ticket age — any "how long did it take?" question between two recorded dates.
Common mistakes
Did this formula help?
Engine-verified against the sample data aboveDownload the proof sheet (.xlsx)Last reviewed 2026-07-09