fxExcelReps

← How-to guides

How to Calculate Days Between Two Dates in Excel

Excel stores dates as numbers, so the days between two dates is simply the later one minus the earlier one: =C2-B2. Format the result cell as a number. For working days, without weekends and holidays, use NETWORKDAYS.

{"cells": {"A1": "Question", "A2": "Days", "A3": "Working days", "A4": "Complete months", "A5": "Days, both ends counted", "A8": "Start", "A9": "End", "B1": "Answer", "B2": "=B9-B8", "B3": "=NETWORKDAYS(B8,B9)", "B4": "=DATEDIF(B8,B9,\"M\")", "B5": "=B9-B8+1", "B8": 46023, "B9": 46112}, "focus": "B2", "formats": {"B8:B9": {"fmt": "date"}}, "note": "Change the start or end date."}

Calendar days

Subtract the dates. Add 1 if both the first and the last day should count.

=C2-B2Days from start to end.
=TODAY()-B2Days since the date in B2.
=C2-TODAY()Days left until the date in C2.

Working days

NETWORKDAYS counts Monday to Friday, both ends included. Add a list of holidays as the third argument.

=NETWORKDAYS(B2, C2)Working days between the two dates.
=NETWORKDAYS(B2, C2, $H$2:$H$20)Without the public holidays in H2:H20.

Months and years

DATEDIF counts complete months or years.

=DATEDIF(B2, C2, "M")Complete months.
=DATEDIF(B2, C2, "Y")Complete years.

Common mistakes

The result looks like a date
The cell kept the date format. Change it to Number (Home → Number Format).
#VALUE! error
One of the dates is text. Check with =ISNUMBER(B2) and convert it.

Frequently asked questions

Does NETWORKDAYS count the start date?

Yes, both the start and the end date. See NETWORKDAYS.

How do I add 30 days to a date?

=B2+30. For 30 working days: =WORKDAY(B2, 30).

How do I calculate someone's age?

See calculate age.

Practise it

NETWORKDAYSDATEDIFTODAY

Think you know this?

15 formula tasks, no hints, with a leaderboard. Absolute, relative and mixed references included.

Take the Pro Challenge →

More how-to guides

How to Get the Last Day of the Month in Excel

Get the last day of a month in Excel with EOMONTH, plus the first day of the month, the number of days and the last working day.

How to Calculate Percentage Change in Excel

Calculate the percentage increase or decrease between two numbers in Excel with (new - old) / old, and format the result as a percent.

How to Calculate the Percentage of a Total in Excel

Calculate each row's share of a total in Excel with an absolute reference, so the formula works when copied down. Live example.

How to Count Unique Values in Excel

Count distinct values in an Excel column with COUNTA and UNIQUE, or SUMPRODUCT and COUNTIF in older versions, with a condition too.