Excel guide · 3 min read
How to calculate days between two dates in Excel
=C2-B2. Excel stores dates as day numbers, so the result is the number of days. =DAYS(C2,B2) gives the same answer.Sample data
Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | C | |
|---|---|---|---|
| 1 | Task | Start | End |
| 2 | Website redesign | 2026-03-02 | 2026-04-17 |
| 3 | Audit | 2026-01-12 | 2026-01-30 |
| 4 | Hiring | 2026-02-15 | 2026-05-01 |
| 5 | Office move | 2026-06-29 | 2026-06-01 |
Method 1: Subtract the dates
Every Excel date is a whole number counting from 1 January 1900, so end minus start is the gap in days. 2 March to 17 April 2026 is 46 days.
If the answer shows as a date like 15/02/1900, Excel copied the date format. Set the cell to General or Number with Home > Number.
Result: 46
Returns 46 days for the website redesign.
Method 2: The DAYS function
DAYS(end_date, start_date) does the same subtraction but reads more clearly, and it also accepts dates typed as text in quotes, like =DAYS("2026-04-17","2026-03-02"). Note the order: end date first. It is available in Excel 2013 and later.
Result: 18
Returns 18 days for the audit.
Count both the first and last day
Subtraction counts the nights between, not the calendar days you touch. A booking from Monday to Friday is 4 by subtraction but 5 days if both ends count. Add 1 when you need an inclusive count, such as for leave requests or event days.
Result: 19
Returns 19, counting both 12 and 30 January.
DATEDIF with "d" and negative results
DATEDIF(start, end, "d") also returns the days between, but it gives #NUM! if the start is after the end. Plain subtraction gives a negative number instead, which is useful for spotting rows where the dates were swapped. The office move row has its end before its start.
Result: -28
Returns -28, a sign the start and end dates are the wrong way round.
Only count working days
To skip weekends, use NETWORKDAYS: =NETWORKDAYS(B2,C2). It counts Monday to Friday, including both ends, and can skip a list of holidays too. See the working days guide for details.
Common mistakes
#VALUE! when subtracting
One of the dates is text, not a real date. Real dates are right-aligned by default. Fix them with Data > Text to Columns > Finish or DATEVALUE.
The result looks like a date
Change the format to General. The number is right; only the display is off.
Off by one
Decide whether you want days between (subtract) or days including both ends (subtract, then add 1), and stick to it across the sheet.
FAQ
What is the formula for days between two dates in Excel?
=end-start, such as =C2-B2, or =DAYS(C2,B2). Both return the number of days between the two dates.
How do I count days from a date until today?
Use =TODAY()-B2 for days since a date, or =B2-TODAY() for days left until it. TODAY() updates every time the workbook recalculates.
How do I calculate days excluding weekends?
Use =NETWORKDAYS(start,end). Add a range of holiday dates as a third argument to skip those too.
Why does subtracting dates give a strange decimal?
One of the cells holds a time as well as a date, such as 17/04/2026 14:30. Excel stores the time as a fraction of a day. Wrap the result in INT, like =INT(C2-B2), to keep whole days only.
How do I calculate weeks between two dates?
Divide the days by 7: =(C2-B2)/7. Wrap it in INT to get whole weeks, or use ROUND if you want the nearest week. For the website redesign that is 6.57 weeks, or 6 whole weeks.
Which method should I use?
Plain subtraction is the quickest and easiest to read. Use DAYS when your dates might be typed as text, DATEDIF when you also need months or years, and NETWORKDAYS whenever weekends should not count.
Functions used
DAYSDays between datesDATEDIFWhole years, months or days betweenNETWORKDAYSWeekdays between datesTODAYToday’s date
Related guides
- How to count working days between two dates in Excel
- How to calculate months between two dates in Excel
- How to calculate age in Excel from date of birth
- How to add months to a date in Excel
- Excel formulas cheat sheet: the 25 everyone should know
Updated