Calculate days and elapsed time between two dates in Google Sheets

Use simple subtraction, DAYS, and DATEDIF to get total days, years/months/days breakdown, and elapsed time (hours/minutes/seconds) between two date or timestamp cells in Google Sheets.

What the video covers

Show how to: 1) get total days between two date cells with subtraction or DAYS, 2) produce a years/months/days breakdown with DATEDIF, and 3) compute and format elapsed time for full timestamps including total seconds.

Watch the video on YouTube

Step-by-step instructions

  1. Set up date/timestamp cells
    Put the start date (or start date+time) in one cell and the end date (or end date+time) in another (for example A2 = start, B2 = end). Ensure those cells are recognized as dates or datetimes, not plain text.
  2. Get total days using subtraction
    Enter =B2-A2 in an output cell. The result is the number of days between the two dates. If you prefer a function form, use =DAYS(B2, A2) instead.
  3. Break down into years, months, days with DATEDIF
    Use DATEDIF to extract parts: =DATEDIF(A2, B2, "Y") for full years, =DATEDIF(A2, B2, "YM") for remaining months after years, and =DATEDIF(A2, B2, "MD") for remaining days. Combine into a readable string if desired: =DATEDIF(A2,B2,"Y") & " Years, " & DATEDIF(A2,B2,"YM") & " Months, " & DATEDIF(A2,B2,"MD") & " Days".
  4. Calculate elapsed time for timestamps
    When cells include times, use =B2-A2 to get the raw elapsed duration. Then apply a duration number format to the result so it displays as hours:minutes:seconds and does not wrap every 24 hours.
  5. Show total hours or total seconds
    To get total hours, multiply the day-difference by 24: =(B2-A2)*24. For total seconds, multiply by 86400: =(B2-A2)*86400. Format those cells as Number (no date/time formatting) to see the numeric totals.

Watch the video

Video thumbnail for Calculate days and elapsed time between two dates in Google Sheets Play tutorial

Watch on YouTube

Why it matters

Manually counting days or estimating elapsed durations is slow and error-prone. Google Sheets has built-in date arithmetic and functions that return exact day counts and human-readable duration breakdowns, saving time and increasing accuracy for project timelines and time tracking.

Check your result

You should see: a numeric total of days (e.g., 254), separate values for years/months/days (e.g., 0 Years, 8 Months, 11 Days), and a duration formatted as hours:minutes:seconds (or a total-seconds value) when timestamps are used.

Troubleshooting

If results look wrong: • Date cells may be plain text — convert them to date/time values. • Subtraction or DAYS can return negative values if end start — swap cells or use ABS if you need absolute duration. • DATEDIF can return unexpected month/day portions near month boundaries; double-check start/end calendar dates. • Elapsed duration may reset every 24 hours if not formatted as a duration or with a cumulative hours format — apply a duration number format or a custom format like h:mm:ss to show total hours. • For seconds: ensure you multiply the serial-day difference by 86400 (seconds/day) and format the cell as Number.