Skip to content

Days between two dates

Pick two dates to count the days, whole months or whole years between them, and get the Excel formula that does the same.

C274days
Cell C2
Formula: =DAYS(B2,A2)

In your sheet: put the start date in A2 and the end date in B2, then type this formula in C2.

Your values

Sample values. Change them to yours.

Cell A2
Cell B2

Adds 1, so Monday to Friday counts as 5 days, not 4.

An Excel file with these values and the formula, ready to reuse.

How to use it

  1. Pick the start date and the end date.
  2. Choose days, whole months or whole years. For days, turn on Count both dates when the first day counts too.
  3. Copy the formula. In your sheet, put the start date in A2 and the end date in B2, then paste the formula in C2.

How it works

Excel stores every date as a whole number: the count of days since the start of 1900. Jan 5, 2026 is day 46027 and Mar 20, 2026 is day 46101, so the days between them are 46101 minus 46027, which is 74.

=DAYS(B2,A2) does that subtraction for you, with the end date first, in the same order as end minus start. =B2-A2 gives the same number, but Excel can copy the date format into the answer, so the 74 shows up as a date in March 1900. Format the cell as General and the count comes back.

Whole months and whole years come from DATEDIF, which counts only complete units: =DATEDIF(A2,B2,"m") for months and "y" for years. Jan 31 to Mar 30 is 1 whole month, because the second month isn't complete until Mar 31. DATEDIF is an old function that Excel keeps for workbooks made in Lotus 1-2-3. Excel doesn't list it or suggest it while you type, so type it in full.

A project office uses it to track how many days are left before each deadline. With =TODAY() in A2 and the deadline in B2, =DAYS(B2,A2) counts down by itself every day.

Learn it properly

These lessons explain dates step by step. Then you type the formulas yourself in a practice sheet and see straight away if they're right.

  • Add and subtract days with dates

    In Text and Dates

    Work out due dates and the days between two dates, knowing that a date is a count of days and a time is part of a day.

    Free6 min· 4 exercises

    Open the lesson
  • Count full years and months with DATEDIF

    In Text and Dates

    Work out the complete years and months between two dates, for length of service, ages and awards.

    Premium6 min· 4 exercises

    Open the lesson

Questions

Does it count the start date?

No. From Monday to Friday is 4 days, the way a subtraction counts. When both days count, as for a five-day course, turn on Count both dates and the formula adds 1.

Why does my answer look like a date?

Excel sometimes copies the date format from the cells you subtracted into the answer, so a count of 74 shows up as a date in March 1900. Format the cell as General or Number to see the count.

What if the end date is before the start date?

DAYS gives a negative number of days. DATEDIF returns #NUM! instead, so put the earlier date first.

How do I count from today?

Put =TODAY() in A2. The answer then updates by itself every day.

How do I count only working days?

Use NETWORKDAYS, which leaves out weekends and holidays. The working days calculator gives you the formula.

More free tools

All tools