Excel formula builder
Date Difference Formula Builder
Create a date difference formula for days, months, or years using date cell references.
Builder inputs
Use cells that contain real spreadsheet dates.
=B2-A2 =B2-A2 Subtracting dates returns calendar days. How this formula works
- For days, spreadsheets can subtract the start date from the end date.
- For completed months or years, DATEDIF returns whole elapsed periods.
- The result depends on valid date values, not text that only looks like a date.
Sample data
| Start Date | End Date | Expected Days |
|---|---|---|
| 2026-01-01 | 2026-01-31 | 30 |
| 2026-02-10 | 2026-03-12 | 30 |
| 2026-04-15 | 2026-05-01 | 16 |
Common mistakes
- Text dates can break subtraction and DATEDIF.
- DATEDIF returns completed periods, not rounded months or years.
- If end date is before start date, the result can be negative or an error depending on the formula.
Related formulas
FAQ
Are these formulas generated with AI?
No. The builder uses deterministic TypeScript functions in the browser and does not call any AI API.
Do I need to upload my spreadsheet?
No. Enter ranges and criteria manually. The site does not upload, store, or process spreadsheet files.
Can I copy the generated formula?
Yes. Each output includes a copy button so you can paste the formula into Excel or Google Sheets.