🟩 Sheet Formulas

Google Sheets Date Difference Calculator

Quick answer: To find the difference between two dates in Google Sheets, subtract them with <code>=B1-A1</code> for whole days, or use <code>=DATEDIF(A1, B1, "D")</code> for days ("M" for months, "Y" for years). Use <code>=NETWORKDAYS(A1, B1)</code> to count only working days.

Enter two dates to see the gap in days, weeks, months and years instantly — then grab the exact Google Sheets formula (subtraction, DATEDIF or NETWORKDAYS) for your own cells.

Instant date difference

Type two dates — get the gap straight away, no formula needed.

Pick two dates above.

Build the Google Sheets formula

Point it at your cells, pick what to count, copy the formula.

=B1-A1

How this date-difference calculator works

The simplest date difference in Google Sheets is plain subtraction: =B1-A1 gives the number of days between two dates, because dates are stored as serial numbers. Divide by 7 for weeks.

For complete months or years you need DATEDIF(start, end, unit). The unit is a quoted text code and that trips everyone up: "Y" = whole years, "M" = whole months, "D" = days, "YD" = days ignoring the year, "YM" = months ignoring the year, "MD" = days ignoring month and year. DATEDIF counts only completed periods, so from Jan 31 to Mar 1 is 1 month, not 2. Always put the earlier date first or DATEDIF returns #NUM!.

To count only working days (Mon–Fri, weekends skipped) use =NETWORKDAYS(start, end); add a third argument with a range of holiday dates to skip those too. The builder above writes whichever of these you pick.

Common ready-to-paste examples

Days between two dates in A1 and B1:

=B1-A1

Whole months between a start and end date:

=DATEDIF(A1, B1, "M")

Whole years (someone's age from a birthdate in A1):

=DATEDIF(A1, TODAY(), "Y")

Working days between two dates (weekends excluded):

=NETWORKDAYS(A1, B1)

Full breakdown — years, months and days:

=DATEDIF(A1, B1, "Y")&" yr "&DATEDIF(A1, B1, "YM")&" mo "&DATEDIF(A1, B1, "MD")&" d"

FAQ

How do I calculate the number of days between two dates in Google Sheets?

Subtract one cell from the other: =B1-A1, where A1 is the earlier date and B1 the later one. Dates are stored as numbers, so the result is the count of days. Format the result cell as a plain number, not a date, or you'll see a date instead of a count.

Why does DATEDIF give a #NUM! error?

Almost always because the start date is later than the end date — DATEDIF requires the earlier date first. It also errors if a cell isn't a real date (it's text). Fix the order, and make sure both cells are genuine dates (right-aligned by default).

How do I count only working days, skipping weekends?

Use =NETWORKDAYS(start, end). It counts Monday–Friday and skips Saturdays and Sundays. To skip public holidays too, add a third argument pointing at a range of holiday dates: =NETWORKDAYS(A1, B1, D1:D10).

How do I get years, months and days all at once?

Combine three DATEDIF calls with text: =DATEDIF(A1,B1,"Y")&" yr "&DATEDIF(A1,B1,"YM")&" mo "&DATEDIF(A1,B1,"MD")&" d". The "YM" and "MD" units give the leftover months and days after the full years.