To calculate the days between two dates in Excel, subtract the earlier date from the later date or use the DAYS function.

The right approach depends on whether you need elapsed days, business days, or a count that includes both endpoints.

Subtract one date from another

Excel stores dates as serial numbers, so subtracting one valid date from another returns the number of days between them.

If the start date is in cell A2 and the end date is in B2, enter this in C2:

=B2-A2

For example, if A2 contains 1/10/2026 and B2 contains 1/15/2026, the result is 5.

This counts elapsed days: January 10 to January 15 spans five days.

To calculate the difference in the opposite direction, subtract A2 from B2 only when the later date is in B2; otherwise the result will be negative.

Format the result cell as General or Number if Excel displays it as a date.

Select the cell, open the Number Format menu on the Home tab, and choose General or Number.

A date format applied to the result can make the serial-number difference appear as another calendar date.

Use the DAYS function

The DAYS function returns the number of days between two dates.

Its syntax is:

=DAYS(end_date, start_date)

With the dates in A2 and B2, use:

=DAYS(B2,A2)

This returns 5 for the January 10 to January 15 example.

The argument order matters: the end date comes first, followed by the start date.

Reversing the arguments returns -5.

DAYS is available in Excel 2013 and later, including Microsoft 365.

For compatibility with older Excel versions, date subtraction is a straightforward alternative.

Both methods require valid date values or cell references that Excel recognizes as dates.

Count both the start and end dates

Subtracting dates gives elapsed days and does not count the starting day as a full additional day.

If a project runs from January 10 through January 15 and you want to count every calendar date touched, add 1:

=B2-A2+1

The result is 6, covering January 10, 11, 12, 13, 14, and 15.

Use this inclusive count when counting days of a trip, a campaign period, or a date range where both boundary dates are included.

For elapsed time, leave off +1.

Calculate working days instead of calendar days

To count weekdays between dates while excluding Saturdays and Sundays, use NETWORKDAYS:

=NETWORKDAYS(A2,B2)

NETWORKDAYS counts the start and end dates if they are working days.

For January 10 through January 15, 2026, the inclusive weekday count is 4, because January 10 and 11 are weekend days and January 12 through 15 are weekdays.

To exclude holidays listed in D2:D10, add the holiday range as the third argument:

=NETWORKDAYS(A2,B2,D2:D10)

The holiday cells should contain valid Excel dates.

To use a different weekend pattern, such as a Friday–Saturday weekend, use NETWORKDAYS.INTL.

Its optional weekend argument supports weekend codes or a seven-character pattern, where 1 marks a nonworking day and 0 marks a working day.

Calculate days from today

To find how many days remain until a date in A2, subtract today’s date from the target:

=A2-TODAY()

A future date produces a positive number, today produces 0, and a past date produces a negative number.

TODAY updates when the worksheet recalculates, so the result can change from one day to the next.

To show only days that have already passed, reverse the subtraction:

=TODAY()-A2

Handle blanks and invalid date entries

A blank cell can behave like zero in date arithmetic, producing an unexpectedly large result.

If either date might be missing, return a blank until both cells contain values:

=IF(OR(A2="",B2=""),"",B2-A2)

Excel comparison operators such as = belong inside the formula text.

If a cell contains a date stored as text, subtraction or DAYS may return #VALUE!.

Check whether the entry is recognized as a date; if necessary, convert text dates with Text to Columns or a suitable DATEVALUE formula.

Date parsing can depend on regional settings, so a string such as 03/04/2026 may mean March 4 or April 3 depending on the workbook’s locale.

If the inputs include times, subtracting them returns a fraction of a day as well as the whole days.

For a whole-day count that ignores time, use:

=INT(B2)-INT(A2)

For example, this removes the time portion from each date before subtracting.

If you need to count any partial day as a full day, a different rounding rule may be appropriate; define that rule before choosing a formula.

Check date order and result formatting

For consistent positive results when the dates may appear in either order, use MIN and MAX:

=MAX(A2,B2)-MIN(A2,B2)

This returns the absolute number of elapsed days.

It does not indicate which date came first, so keep a separate check if date order matters.

To flag a reversed range, you could use:

=IF(B2<A2,"End date is earlier",B2-A2)

Finally, verify that the result cell uses a numeric format and that the source cells contain dates rather than labels or text.

Use date subtraction for a simple elapsed-day difference, DAYS when its named arguments make the formula easier to read, NETWORKDAYS for weekdays, and an added 1 when both boundary dates should count.