Skip to content

DAYS

Returns the number of calendar days between two dates, as end date minus start date.

Syntax

=DAYS(, )

Date and time

Excel 2013 and later.

Try it

Edit the formula in C2 or change the inputs. The sheet recalculates as you type.

C2
A
B
C
1
Start
End
Days
2
01-Jan-2025
15-Mar-2025
73
3

C2 =DAYS(B2,A2) returns 73

How DAYS works

DAYS returns the number of calendar days between two dates. =DAYS(B2,A2) is the end date in B2 minus the start date in A2. With 1 January and 15 March 2025 it returns 73. It counts every day, weekends included. For working days only, use NETWORKDAYS.

The argument order

The end date comes first and the start date second: DAYS(end_date, start_date). This catches many people out, because DATEDIF and NETWORKDAYS take the earlier date first. If you swap them, DAYS doesn't return an error. It returns the same number with a minus sign. A negative result is the clue that the order is wrong, unless you intend a negative result to mean "overdue".

DAYS and plain subtraction

=DAYS(B2,A2) and =B2-A2 give the same answer. DAYS makes the intent obvious to the next reader and accepts text dates directly: =DAYS("2025-12-31","2025-01-01") returns 364. Subtraction is shorter and works in every version of Excel, so use it where compatibility with Excel 2010 or earlier matters. If your cells hold timestamps, subtraction keeps the time-of-day fraction, so =B2-A2 can return 1.5 for a gap of a day and a half.

The start day isn't counted

DAYS returns the gap between the dates, not the number of dates touched. From Monday to Friday of the same week, DAYS returns 4. If you want to include both end dates, add 1: =DAYS(B2,A2)+1. That matches what someone means by "a stay of 5 days, Monday to Friday".

Patterns

  • Days until a deadline: =DAYS(B2,TODAY()).
  • Days overdue: =MAX(0,DAYS(TODAY(),B2)).
  • Days in a year: =DAYS(DATE(A2+1,1,1),DATE(A2,1,1)) returns 366 for a leap year.
  • Days in a month: =DAYS(EOMONTH(A2,0),EOMONTH(A2,-1)).
  • Daily rate: =Total/DAYS(End,Start).

Compared with DATEDIF

DATEDIF with "d" also counts days, but it returns #NUM! if the start date is later than the end date, and it takes the earlier date first. DATEDIF can also count months and years. DAYS only counts days.

DAYS returns #VALUE! if either argument is text that isn't a date.

Arguments

end_date
The later date. It comes first, which is the opposite of how most people write "from, to".
start_date
The earlier date. If it is later than end_date, the result is negative.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Days between two dates

C2 =DAYS(B2,A2)

Result: 73

The end date goes first. 15 March is 73 days after 1 January.

C2
A
B
C
1
Start
End
Days
2
01-Jan-2025
15-Mar-2025
73
3

C2 =DAYS(B2,A2) returns 73

Example 2

Negative when the dates are reversed

C2 =DAYS(A2,B2)

Result: -73

Swapping the arguments gives the same number with a minus sign, not an error.

C2
A
B
C
1
Start
End
Days
2
01-Jan-2025
15-Mar-2025
-73
3

C2 =DAYS(A2,B2) returns -73

Example 3

Days between two text dates

C2 =DAYS(B2,A2)

Result: 364

DAYS accepts text that Excel reads as a date. ISO year-month-day text is read the same way on every machine.

C2
A
B
C
1
Start (text)
End (text)
Days
2
2025-01-01
2025-12-31
364
3

C2 =DAYS(B2,A2) returns 364

Example 4

Inclusive count of a stay

C2 =DAYS(B2,A2)

Result: 4

Hotels charge by the night, so 10 to 14 March is 4 nights. For "calendar days touched", add 1 and get 5.

C2
A
B
C
1
Check in
Check out
Nights
2
10-Mar-2025
14-Mar-2025
4
3

C2 =DAYS(B2,A2) returns 4

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In C2, return the number of days from the start date to the end date. Fill it down to C4.

Answer in C2, then it fills down to C4.

C2
A
B
C
D
E
1
Start
End
Days apart
Days incl. both ends
2
01-Jan-2025
15-Mar-2025
3
10-Mar-2025
14-Mar-2025
4
01-Feb-2024
01-Mar-2024
5

Common mistakes

  • The end date comes first. DAYS(A2,B2) with the start date first returns a negative number, not an error.
  • DAYS doesn't include the start day. Monday to Friday is 4. Add 1 for a count that includes both ends.
  • DAYS counts weekends. Use NETWORKDAYS for working days.
  • DAYS needs Excel 2013 or later. In older versions the formula returns #NAME?, so use subtraction.
  • Text dates that aren't in a format Excel can read return #VALUE!.

Questions people ask

How do I calculate the number of days between two dates in Excel?

Use `=DAYS(B2,A2)` with the end date first, or subtract: `=B2-A2`. Format the result cell as General or Number, not as a date.

Why does DAYS return a negative number?

The start date is later than the end date, or the arguments are in the wrong order. DAYS takes the end date first.

What is the difference between DAYS and DATEDIF?

DAYS counts days only and takes the end date first. DATEDIF counts days, months or years, takes the start date first, and returns `#NUM!` for reversed dates.

Why does my result show as a date?

Excel sometimes copies the date format from the input cells. Change the result cell's format to General, and 73 appears instead of a date in March 1900.

Learn DAYS in a real sheet.

Tracks take you from the basics to modelling, one graded exercise at a time.