A date difference in Google Sheets is the gap between two dates expressed as a count of days, months, or years, and you can pull it with built-in formulas like DATEDIF, a simple subtraction, or with a free date difference calculator that returns the same answers without a formula. When two cells already store real date values, Sheets treats each date as a serial number where one day equals 1, so subtracting the earlier cell from the later cell gives you the raw gap in days. For richer outputs like weeks between two dates, a clean years-months-days breakdown, or a working-day count that skips weekends, a dedicated tool saves you from stacking nested formulas and chasing #NUM! errors. The guide below walks through the Sheets-native options step by step, then shows the fastest way to get a calendar-correct answer without typing a single formula.

how to calculate date difference in google sheets
how to calculate date difference in google sheets

What Counts as a Date Difference in Google Sheets

Before reaching for a formula, it helps to understand exactly what Google Sheets can report. Internally, a date in a cell is just an offset from December 31, 1899, which is day 1. Every later day adds 1, every earlier date is negative, and a time-of-day component sits after the decimal point. Because dates are numbers underneath, the difference between any two valid date cells is also a number — but the unit you read off depends on which formula or formatting you choose.

Sheets can give you the gap in three built-in flavors: total days, total months, total years, plus a few mixed-unit variants. Each one ignores the time-of-day component when both cells hold midnight values, and each one respects the Gregorian calendar including leap years. The catch is that the format you ask for has to match the formula you write. If you only need days, subtraction works. If you need a specific calendar-aware unit, DATEDIF is the function Google preserved from Lotus 1-2-3 for exactly this job.

Calculate a Date Difference in Google Sheets Step by Step

The two-cell setup is the same for every Sheets method: put your start date in cell A2, your end date in cell B2, and make sure both are formatted as Date (Format → Number → Date). Once those cells hold valid dates, you have several ways to read the gap.

  1. Total days with simple subtraction. In an empty cell, type =B2-A2 and format the result as a number. Sheets returns the raw gap in days because each cell already represents days since 1899. If the cell shows a date instead of a number, change the format to Number.
  2. Years, months, or days with DATEDIF. Type =DATEDIF(A2, B2, "Y") for whole years, =DATEDIF(A2, B2, "M") for whole months, or =DATEDIF(A2, B2, "D") for total days. The function understands six unit codes: Y, M, D, MD, YM, and YD, where MD returns leftover days after whole months, YM returns leftover months after whole years, and YD returns leftover days after whole years.
  3. Build a years-months-days breakdown. Combine three DATEDIF cells with =CONCATENATE(DATEDIF(A2,B2,"Y")," year, ",DATEDIF(A2,B2,"YM")," months, ",DATEDIF(A2,B2,"MD")," days"). This is the formula equivalent of the calculator's breakdown panel and reads the way people actually say a duration.
  4. Working days with NETWORKDAYS. For a Monday-through-Friday count, type =NETWORKDAYS(A2, B2). Sheets returns the number of working days, automatically excluding Saturdays and Sundays. Use NETWORKDAYS.INTL if your week starts on a different day or you need a non-standard weekend mask.

Two things tend to trip people up. First, DATEDIF returns #NUM! when the start date is later than the end date, so always put the earlier date first. Second, all of these formulas recompute when you edit the dates — there is no caching and no rounding mode to set. If you only need a one-off answer or you keep getting tangled up in unit codes, the calculator below removes those steps.

Get the Same Answer Without a Formula

The Date Difference Calculator covers the same ground as the formulas above without the formula. There is no cell to format, no unit code to memorize, and no result column to clean up. Everything updates live as you pick dates, so you can experiment with different end dates and watch the days, weeks, months, and the years-months-days breakdown change in real time.

  1. Pick your start date in the first field. It defaults to today, so for most cases you can leave it as-is and only adjust the second field.
  2. Pick your end date in the second field. The total days, weeks, whole months, and the years-months-days breakdown appear right below the inputs — there is no Calculate button to press.
  3. Read the results. The total days figure is the calendar difference between the two dates. The weeks count is total days divided by seven and rounded down, and the years-months-days breakdown fills whole years first, then whole months, then leftover days, in the same way date-fns intervalToDuration works. Tick the "weekdays only" checkbox to switch the totals into a working-day and weekend-day split.

Everything runs in your browser, so the dates you enter never leave your device and nothing is uploaded, stored, or sent anywhere. There is no signup and no limit on how many calculations you run, which makes it easy to test a few "what if" end dates before settling on the right one.

Reading Days, Weeks, Months, and the Years-Months-Days Breakdown

Each result in the calculator serves a different purpose, and knowing what to read off saves you from misinterpreting the number. The total days figure is the calendar difference between the two dates, which means it already accounts for the length of every month in between and for any February 29 that falls in the span. January 1, 2020 to March 1, 2020 is 60 days because 2020 is a leap year and February had 29 days that year; the same start and end dates in 2021 are 59 days because February had 28.

Weeks are shown as whole weeks only — they are the total days divided by seven and rounded down. A 60-day gap shows as 8 weeks with 4 days left over (60 ÷ 7 = 8 with remainder 4), and those leftover days are still part of the total days figure, so you never lose information. Months are counted the same way: only complete months are included, and the counting uses the same end-of-month clamping as adding months to a date, which means a span that is one day short of a full month is not rounded up.

The years-months-days breakdown is the piece that reads the way people actually speak. Instead of asking you to do the math, the calculator fills whole years first, then whole months, then leftover days, moving the start anchor forward at each step. That avoids the classic off-by-one errors you get from naive subtraction around month ends and leap days. The parts always add back up to the end date exactly: if the breakdown says "1 year, 2 months, and 5 days", adding that span to the start date lands precisely on the end date. Picking the same date twice returns zero, and swapping the start and end dates never produces a negative number — the calculator measures the gap either way and gives you a clean positive answer.

Weekdays-Only Mode and Working-Day Counts

Total calendar days are useful for trip length and subscription terms. For project deadlines, probationary periods, and notice periods, you usually want working days, which means counting Monday through Friday and excluding Saturday and Sunday. The "weekdays only" toggle in the calculator splits the span into two numbers: working days and weekend days. The two counts always add up to the total days, so you can sanity-check them at a glance, and you can flip the toggle off and on without re-entering any dates.

One important limit to know: this is a general weekday count. It does not subtract public holidays, and it does not know about regional calendars, so a span that crosses Christmas Day will still count December 25 as a working day. For a holiday-aware working-day count — for example, US federal holidays, UK bank holidays, or a custom company calendar — use a dedicated Business Days Calculator that lets you pick a holiday set or list specific dates to exclude.

Inside Google Sheets, the equivalent of the weekdays-only mode is the NETWORKDAYS function, which returns whole working days between two dates and accepts an optional list of holidays. NETWORKDAYS.INTL adds a weekend mask so you can define any two-day weekend, not just Saturday and Sunday. Both are quick to write, but like DATEDIF they expect the start date to come first; swap them and you get a #NUM! error, which is another reason many readers prefer a tool that auto-corrects the order.

Sheets Formula or Calculator? Picking the Right Approach

Sheets formulas are the right tool when you want a live, persistent number in a cell — for example, a project dashboard that always shows the current gap between today and a target launch date, or a payroll sheet that needs to age every invoice automatically. The cells update themselves, the formulas survive copy-paste, and there is no browser tab to keep open. For one-off answers, cross-checking, or quick decisions, the calculator removes the parts that slow you down.

Use caseBest approachWhy
One-off answer to a single questionDate Difference CalculatorNo formula to write, result updates live
Live dashboard with a running total=B2-A2 or DATEDIF in a cellAuto-updates when source dates change
Working-day count with public holidaysBusiness Days CalculatorHoliday-aware tool for official calendars
What day of the week the deadline falls onDay of the week guideQuick lookup without opening a sheet
Adding 30 days to a single dateDATE function or a date-add toolDifferent operation from gap measurement

You also avoid the trap of swapping start and end dates by accident; the calculator measures the gap either way and never returns a negative number, so you always get a clean positive answer. Another quiet advantage is how it treats month-end clamping and February 29: the breakdown uses calendar-correct clamping rather than a rough division, the same approach date-fns intervalToDuration uses, so spans that cross a leap day come out one day longer than they would in a non-leap year.

Related reading: How to Convert Date Format in SQL: CONVERT, CAST, FORMAT.