FormulaCraft

How to calculate the days between two dates in Excel and Google Sheets

Topic:Date arithmetic
Excel & Google Sheets
=B2-A2

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Enter your start date in column A (e.g., A2) and your end date in column B (e.g., B2), both formatted as dates.
  2. 2In an empty cell, enter =B2-A2.
  3. 3If the result appears as a date, format the cell as a Number: right-click, Format Cells, Number.
  4. 4The result is the number of calendar days between the two dates.
  5. 5Alternatively, use the DAYS function: =DAYS(B2,A2) which is slightly more explicit and readable.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

Should I use =B2-A2 or =DAYS(B2,A2)?

Both return the same result. Simple subtraction is universally supported; DAYS() makes the intent clearer and is available in Excel 2013+ and all Google Sheets versions.

How do I get an absolute (positive) number of days regardless of order?

Wrap with ABS: =ABS(B2-A2) to ensure a positive result even if the start date is later than the end date.

More on Date arithmetic

See all →

Formulas used

Related tasks

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: