FormulaCraft

How to subtract one date from another 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. 1Place the start date in A2 and the end date in B2.
  2. 2In a result cell, enter =B2-A2.
  3. 3If the result looks like a date, format the result cell as a Number (not a Date).
  4. 4For a negative result (indicating the end date is before the start), use =ABS(B2-A2) to get a positive count.
  5. 5For months or years, switch to =DATEDIF(A2,B2,"M") or =DATEDIF(A2,B2,"Y").

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

What unit does date subtraction return?

Always days. Dates in spreadsheets are integers (serial numbers), so subtracting one from another yields an integer count of days. Divide by 7 for weeks, or use DATEDIF for months and years.

How do I subtract dates and show the result as 'X days, Y hours'?

Subtract date-time values and multiply the decimal portion by 24 for hours: =INT(B2-A2)&" days, "&INT((B2-A2-INT(B2-A2))*24)&" hours".

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: