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 =DAYS(B2,A2) returns 73
Returns the number of calendar days between two dates, as end date minus start date.
Syntax
=DAYS(, )
Excel 2013 and later.
Try it
Edit the formula in C2 or change the inputs. The sheet recalculates as you type.
C2 =DAYS(B2,A2) returns 73
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 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(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.
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".
=DAYS(B2,TODAY()).=MAX(0,DAYS(TODAY(),B2)).=DAYS(DATE(A2+1,1,1),DATE(A2,1,1)) returns 366 for a leap year.=DAYS(EOMONTH(A2,0),EOMONTH(A2,-1)).=Total/DAYS(End,Start).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.
Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
C2 =DAYS(B2,A2)
Result: 73
The end date goes first. 15 March is 73 days after 1 January.
C2 =DAYS(B2,A2) returns 73
Example 2
C2 =DAYS(A2,B2)
Result: -73
Swapping the arguments gives the same number with a minus sign, not an error.
C2 =DAYS(A2,B2) returns -73
Example 3
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 =DAYS(B2,A2) returns 364
Example 4
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 =DAYS(B2,A2) returns 4
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.
DAYS(A2,B2) with the start date first returns a negative number, not an error.#NAME?, so use subtraction.#VALUE!.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.
The start date is later than the end date, or the arguments are in the wrong order. DAYS takes the end date first.
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.
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.
Tracks take you from the basics to modelling, one graded exercise at a time.