To subtract two dates in Excel, put each date in its own cell and subtract one cell from the other with a simple formula, for example =B2-A2. Excel stores dates as serial numbers, so the result is the number of days between them. The only prerequisite is that Excel actually recognises both values as real dates rather than as text. Once that is true, every other date calculation you are likely to need is a small variation on that same subtraction.
What You'll Need
- Excel on desktop (Windows or Mac), Excel for the web, or Google Sheets - the formulas below work in all of them.
- Two dates entered in separate cells, typed in a format your copy of Excel recognises, such as
2026-12-01or whatever date format your regional settings use. - An empty cell to hold the result, ideally formatted as a number so you see the difference and not a strange date.
Step-by-Step
- Enter the two dates in separate cells. For example, type the start date in
A2and the end date inB2. Type them the way your locale expects: in the UK or Australia,01/12/2026means 1 December; in the US,12/01/2026means 1 December. If the date appears right-aligned in the cell, Excel has read it as a real date. If it sits on the left, it is text and needs fixing first (see Troubleshooting). - Click the empty cell where you want the answer, for example
C2. - Type
=B2-A2and press Enter. Replace the cell references with your own. The result is a plain number: the count of whole days from the earlier date to the later one. - Format the result as a number if it looks odd. Excel sometimes copies the date format from the source cells, so a difference of 30 days might show as
30/01/1900. Select the result cell, open Home > Number Format and choose Number or General. You can also press Ctrl+1 (Windows) or Cmd+1 (Mac) and pick a number format. Menu labels can differ slightly by version, device and region. - Include today's date by using
TODAY(). To find how many days ago a date was, use=TODAY()-A2. To find days remaining until a date, use=A2-TODAY(). The result updates every time the workbook recalculates. - For working days only, use
NETWORKDAYS. Type=NETWORKDAYS(A2,B2)to count Monday to Friday between the two dates, excluding both weekend days. Add a range of holiday dates as a third argument,=NETWORKDAYS(A2,B2,Holidays), whereHolidaysis a named range or a block of cells listing public holidays, and those days are also excluded. - For months or years, use
DATEDIF.=DATEDIF(A2,B2,"m")gives whole months between the dates;"y"gives whole years;"d"gives days. This is handy for ages and tenures. Note thatDATEDIFdoes not appear in Excel's formula autocomplete, so type the whole formula manually or it will look like it does not exist. - Build a full "2 years, 3 months, 4 days" string if you need one. Combine the parts with text:
=DATEDIF(A2,B2,"y")&" years, "&DATEDIF(A2,B2,"ym")&" months, "&DATEDIF(A2,B2,"md")&" days". The"ym"and"md"codes return the leftover months and days after whole years are counted. - Copy the formula down. Drag the fill handle (the small square at the bottom-right of the selected cell) down the column, or double-click it to fill automatically alongside your data. References adjust for each row, so each pair of dates gets its own answer.
- Check the sign. If the earlier date is in the second cell, the answer comes out negative, such as
-45. That is correct arithmetic, not a bug. If you always want a positive number regardless of order, wrap the subtraction inABS:=ABS(B2-A2).
To subtract a number of days from a date - the reverse operation - use =A2-30 and format the result as a date. Adding days works the same way: =A2+30. Excel rolls across months and years automatically, so 25 December minus 30 lands correctly in November of the same year.
Common Mistakes
- Subtracting text that looks like a date. This produces
#VALUE!. A real date is right-aligned by default; a text date is left-aligned. The fix is to convert the text to a real date, not to retype the formula. - Expecting a date back. Subtracting two dates gives a duration in days. If the cell is formatted as a date, you see a meaningless date near 1900 instead of
45. Change the number format. - Using ambiguous day/month order.
03/04/2026is 3 April in most of the world and 4 March in the US. If dates arrive from other people or systems, use an unambiguous format such as2026-04-03when typing, or split them with Data > Text to Columns and set the date order explicitly. - Forgetting that times count too. If cells hold a date and a time, subtraction returns a fractional number, so 1.5 means one and a half days. Round with
=ROUND(B2-A2,0)or=INT(B2-A2)if you want whole days. - Assuming
NETWORKDAYSincludes both ends. It does count both the start and end date if they fall on weekdays, which surprises people calculating notice periods or deadlines. - Typing
DATEDIFarguments in the wrong order. The start date must come first. Reversed arguments return#NUM!.
Tips
- Use
TODAY()rather than typing today's date so the calculation stays current. UseNOW()when you need the current date and time. - Name your holiday list (select the cells, then type a name in the Name Box to the left of the formula bar) so formulas such as
=NETWORKDAYS(A2,B2,Holidays)stay readable. - Press Ctrl+` (the key left of 1) to toggle between showing results and showing every formula - useful for auditing a sheet full of date maths.
- If you need the difference in weeks, divide the day count by 7 and round down:
=INT((B2-A2)/7). - Keep source dates in their own columns and never overwrite them with results; it makes later checks far easier.
Troubleshooting
The formula returns #VALUE! One or both cells contain text. Check alignment: left-aligned dates are text. To convert, try re-entering the date in a recognised format, or use Data > Text to Columns and choose the date option on the third screen so Excel parses it. A formula approach is =DATEVALUE(A2), which turns a text date into a real one.
The answer is a date like 30/01/1900. The formula is right; the format is wrong. Apply a Number format to the result cell.
You get #####. The column is too narrow. Widen it by double-clicking the boundary between column headers.
The result is negative when you expected positive. Your two cells are in the opposite order to what you assumed. Swap the references or wrap the formula in ABS.
Dates entered as 1/2/26 keep flipping. Excel is guessing day and month. Type the full four-digit year, or set the cell format to a clear style such as yyyy-mm-dd before typing.
Frequently Asked Questions
Can I subtract dates in Excel for the web?
Yes. Plain subtraction, TODAY(), NETWORKDAYS and DATEDIF all work in Excel for the web, in the desktop app and in Google Sheets with the same syntax.
Why does Excel show a strange date instead of a number of days?
Excel stores dates as serial numbers starting from 1 January 1900, so subtracting them yields a number. If the cell carries a date format, that number is displayed as a date. Set the format to Number or General.
How do I get the difference in months rather than days?
Use =DATEDIF(start,end,"m") for whole months, or "y" for whole years. Type the formula in full because Excel will not autocomplete it.
Does subtracting dates count weekends?
Plain subtraction counts every calendar day, weekends included. Use NETWORKDAYS if you only want Monday to Friday, and add a holiday range to skip public holidays too.
Can the result be negative?
Yes, if the later date is in the first cell. That is normal; swap the cells or use ABS to always return a positive figure.
Can I subtract a time from a date?
Yes. A cell can hold both, and subtracting gives a fraction of a day. Multiply by 24 to get hours, and format the result as a number rather than a date.