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

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

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

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

Last reviewed: