ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Dates
  3. Days Between Two Dates in Excel (and DATEDIF)

Days Between Two Dates in Excel (and DATEDIF)

By ExcelReady Team·Updated October 30, 2026·6 min read

The short answer

To count the days between two dates in Excel, subtract the earlier date from the later one: =C2-B2. DAYS does the same with the end date first: =DAYS(C2,B2). For whole months or years, use DATEDIF with the start date first and a unit in quotes, like =DATEDIF(B2,C2,"Y").

Key takeaways

  • Later date minus earlier date gives the number of days; add 1 if both the first and last day should count.
  • DAYS takes the end date first; DATEDIF takes the start date first.
  • DATEDIF units: "Y" whole years, "M" whole months, "D" days, "YM" months left over after the years.
  • DATEDIF returns #NUM! when the start date is after the end date.
  • If the answer looks like a date, change the cell's format to General or Number.
On this page+
  1. How do you subtract dates in Excel?
  2. Does Excel count the first day?
  3. How to use the DAYS function
  4. How to use DATEDIF for months and years
  5. How do you count the days from a date until today?
  6. Why doesn't Excel suggest DATEDIF?
  7. Which days between dates Excel formula should you use?
  8. What are the common mistakes?
  9. Practise it

The simplest days between dates Excel formula is plain subtraction: the later date minus the earlier date. For the same answer with a function, use DAYS. For whole months or years, such as tenure, use DATEDIF. This guide shows all three on one HR sheet, with the units, the argument order and the errors to watch for.

How do you subtract dates in Excel?#

Excel stores dates as serial numbers that count days, so subtracting two dates gives the number of days between them. Put the later date first:

Excel formula
=C2-B2

Here B is the hire date and C is the last review:

EmployeeHire DateLast Review=C2-B2
Jordan PriceApr 11, 2016Mar 15, 20242895
Mei ChenAug 26, 2019Sep 2, 20241834
Carlos DiazJan 4, 2021Jun 28, 20241271
Samir PatelJun 13, 2022Dec 9, 2024910

If the result looks like a strange date, such as 12/4/1907 (December 4, 1907), Excel has given the cell a date format. Change it to General (Ctrl+Shift+~ on Windows, Control+Shift+~ on a Mac) to see the number of days.

How the dates in B and C are displayed depends on your regional settings, but the subtraction works the same everywhere. To type a date inside a formula, use DATE, like =C2-DATE(2016,4,11), so it can't be misread.

Does Excel count the first day?#

No. Subtraction counts the days from the start to the end, so Monday to Friday of the same week is 4. If both the first and the last day should count, as in "a booking from the 1st to the 5th is 5 days", add 1:

Excel formula
=C2-B2+1

For weeks, divide by 7: =(C2-B2)/7 gives 413.57 weeks for Jordan, and =INT((C2-B2)/7) gives 413 whole weeks.

How to use the DAYS function#

DAYS does the same job as subtraction, with the end date first:

Excel formula
=DAYS(end_date, start_date)
=DAYS(C2,B2)

For Jordan, both give 2895. DAYS has one advantage: it can read dates typed as text, like =DAYS("2024-03-15","2016-04-11"), and still give a number. But text dates depend on your regional settings, so cell references or DATE are safer. If you get a negative number, the dates are the wrong way round. DAYS needs Excel 2013 or later.

How to use DATEDIF for months and years#

DATEDIF counts complete years, months or days between two dates. The start date comes first, the opposite of DAYS:

Excel formula
=DATEDIF(start_date, end_date, unit)

The unit is a code in double quotes:

UnitCountsJordan (Apr 11, 2016 to Mar 15, 2024)
"Y"Complete years7
"M"Complete months95
"D"Days, like subtraction2895
"YM"Months left over after the complete years11
"MD"Days left over after the complete months4
"YD"Days left over after the complete years339

"Complete" matters. Jordan started on April 11, and his review was on March 15, so his eighth year wasn't finished. He gets 7, not 8. That's why =YEAR(C2)-YEAR(B2), which gives 8, is the wrong answer for tenure.

Combine units to write tenure as text:

Excel formula
=DATEDIF(B2,C2,"Y")&" yrs, "&DATEDIF(B2,C2,"YM")&" mos"

This gives "7 yrs, 11 mos" for Jordan. Microsoft notes that the "MD" unit can give wrong results in some cases, so avoid it in anything important. For more ways to use these units, see how to calculate age or years of service, or read the full DATEDIF function guide.

How do you count the days from a date until today?#

Use TODAY() as the later date. =TODAY()-B2 gives the days since B2, and =B2-TODAY() gives the days left until a future date in B2, such as a deadline. A negative result means the date has already passed.

TODAY() updates every time the file recalculates, so these answers change each day. That's right for a live tracker, but not for a report you need to check later. See TODAY vs NOW in Excel for the difference between the two.

Why doesn't Excel suggest DATEDIF?#

DATEDIF is an older function that Excel keeps for compatibility with other spreadsheet programs. It works in every current version on Windows and Mac, but it isn't listed in the function suggestions and Excel doesn't show its arguments as you type. Type the whole name and the brackets yourself. If you see #NAME?, check the spelling: it's DATEDIF, with one F.

Which days between dates Excel formula should you use?#

Pick the method by the answer you need:

You needUseExample
Days, quick and simpleSubtraction=C2-B2
Days, as a named functionDAYS=DAYS(C2,B2)
Complete months or yearsDATEDIF=DATEDIF(B2,C2,"M")
Working days, Monday to FridayNETWORKDAYS=NETWORKDAYS(B2,C2)
A date a number of months awayEDATE=EDATE(B2,6)

Working days need a different function, because subtraction counts weekends too. See NETWORKDAYS and WORKDAY. To move forward by months rather than measure a gap, see EDATE and EOMONTH.

What are the common mistakes?#

MistakeWhat you seeFix
Earlier date first in subtraction or DAYSA negative numberLater date first
Later date first in DATEDIF#NUM!Start date first
Unit without quotes: DATEDIF(B2,C2,Y)#NAME?"Y" in quotes
Result shows as a dateSomething like 12/4/1907Format as General
One date stored as text#VALUE!Convert it to a real date
TODAY() in a report that must not changeThe answer changes dailyPoint at a fixed "as of" date cell

Tenure up to today uses TODAY() as the end date: =DATEDIF(B2,TODAY(),"Y"). That's right for a live HR sheet. For a report or a test answer that must stay the same, put the date in a cell with DATE and point at that instead. Tenure questions come up often in HR roles; see the Excel skills HR jobs ask for.

Practise it#

Try the DAYS exercise on this page, then practise days between dates and DATEDIF in a live spreadsheet. You'll subtract dates, use DAYS, count years and months with DATEDIF, and build a "7 yrs, 11 mos" tenure label.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

How many days passed between Jordan's hire date in B2 and last review in C2? In D2, use DAYS. Put the end date first: =DAYS(C2,B2).

fx
ABCDE
1
Employee
Hire Date
Last Review
Days
2
Jordan Price
42471
45366
3
Mei Chen
43703
45537
4
Carlos Diaz
44200
45471
5
Samir Patel
44725
45635
6
7
8

Tip: DAYS wants the end date first, then the start date. A negative answer means they are the wrong way round.

Practise this in a lesson

LessonDays between dates: DAYS, DATEDIF and TODAYMeasure the gap between two dates in days, months and years, and calculate tenure as of today.Function guideDATEDIFCalculate tenure, age and contract length with DATEDIF. Learn every unit (Y, M, D, YM), the hidden-function quirks, and practice live.

Frequently asked questions

What is the formula for the number of days between two dates in Excel?

+

Subtract the earlier date from the later one, like =C2-B2. You can also use =DAYS(C2,B2), which puts the end date first.

Does Excel count the start date when counting days?

+

No. =C2-B2 counts the days from the start to the end, so Monday to Friday is 4. Add 1, as in =C2-B2+1, if both days should count.

Why doesn't DATEDIF appear when I type it in Excel?

+

DATEDIF is an older function that Excel keeps for compatibility. It works, but Excel doesn't suggest it or show its arguments, so type the whole formula yourself.

Why does DATEDIF give #NUM!?

+

The start date is later than the end date. Swap the first two arguments so the earlier date comes first.

How do I count only working days between two dates?

+

Use NETWORKDAYS: =NETWORKDAYS(B2,C2) counts Monday to Friday, including both dates. Add a holiday range as a third argument to skip holidays too.

Sources

  • DATEDIF function - Microsoft Support
  • DAYS function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. How do you subtract dates in Excel?
  2. Does Excel count the first day?
  3. How to use the DAYS function
  4. How to use DATEDIF for months and years
  5. How do you count the days from a date until today?
  6. Why doesn't Excel suggest DATEDIF?
  7. Which days between dates Excel formula should you use?
  8. What are the common mistakes?
  9. Practise it

Keep reading

Dates· 6 min read

EDATE and EOMONTH: Add Months and Find Month-End

EDATE moves a date by whole months: =EDATE(start_date, months) keeps the day where it can, so Mar 15 plus 12 months is Mar 15 next year. EOMONTH moves by months and then jumps to the month's last day: =EOMONTH(B2,0) is the end of B2's month. Negative months go backwards.

Dates· 6 min read

Count Working Days With NETWORKDAYS and WORKDAY

NETWORKDAYS counts the working days (Monday to Friday) between two dates, including both dates: =NETWORKDAYS(start_date, end_date, [holidays]). WORKDAY does the reverse and returns the date a number of working days away: =WORKDAY(start_date, days, [holidays]). Both skip weekends, and both skip any dates you list as holidays.

Dates· 6 min read

Calculate Age or Years of Service in Excel

To calculate age in Excel, use =DATEDIF(B2,TODAY(),"Y"), where B2 is the birth date. It counts complete years, so the age only goes up on the birthday. Years of service work the same way with the hire date. For a report that must not change, replace TODAY() with a fixed "as of" date cell.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free