To calculate the number of days between two dates in Excel, subtract the earlier date from the later one: =B2-A2, where A2 holds the start date and B2 holds the end date. That single formula returns the day count as a number, formatted as a date if Excel guesses wrong. For counting working days instead, use =NETWORKDAYS(A2,B2). For counting from today, use =TODAY()-A2 or =DATEDIF(A2,TODAY(),"d").

What You'll Need

  • Any desktop version of Excel (Microsoft 365, Excel 2021, 2019, 2016) or Excel for the web. The formulas here work the same across them.
  • Two dates to compare, ideally each in its own cell rather than typed inside the formula.
  • Cells formatted as dates, or dates typed in a format Excel recognises (for example 12/04/2026 or 2026-04-12).
  • Basic familiarity with selecting a cell and typing a formula that starts with an equals sign.

Step-by-Step

  1. Enter your two dates in separate cells. Put the start date in A2 and the end date in B2. Type them as real dates, not text. If Excel left-aligns the entry, it stored it as text and the formulas below will fail.
  2. Click an empty cell for the result. For example C2, or any cell to the right of your dates.
  3. Subtract the earlier date from the later one. Type =B2-A2 and press Enter. The result is the number of days from the start date up to but not including the end date. If A2 is 1 April and B2 is 11 April, you get 10.
  4. Fix the result if it shows a date instead of a number. Excel sometimes copies the date format from the source cells. Select the result cell, open the Number Format dropdown on the Home tab, and choose General or Number. The date serial value now appears as a plain day count.
  5. Include both the first and last day if that is what you mean. Add 1: =B2-A2+1. Counting from 1 April to 11 April inclusive gives 11 days. Use this when counting hotel nights-inclusive, leave days, or event duration where the final day counts.
  6. Count only working days with NETWORKDAYS. Type =NETWORKDAYS(A2,B2). This excludes Saturdays and Sundays automatically. To skip holidays too, list your holiday dates in a range such as F2:F12 and use =NETWORKDAYS(A2,B2,F2:F12). The function includes both the start and end date in its count.
  7. Try the flexible alternative, DATEDIF. Type =DATEDIF(A2,B2,"d") for whole days, "m" for complete months or "y" for complete years. The result does not count the end date, and the function returns an error if the start date is later than the end date.
  8. Calculate days from a fixed date to today. Use =TODAY()-A2. TODAY() updates every time the workbook recalculates, so the count moves forward on its own. This is what you want for age of an invoice, days since a task opened, or days remaining: =B2-TODAY().
  9. Copy the formula down the column. Drag the fill handle at the bottom-right of the result cell, or double-click it, to fill the formula for every row. Relative references adjust automatically, so row 3 uses B3 and A3.

Common Mistakes

  • Dates stored as text. If subtraction returns #VALUE!, one cell contains text that looks like a date. Check alignment and try converting with Data > Text to Columns, choosing the date format on the way through, or retype the date.
  • Off-by-one counting. Plain subtraction excludes the end date. Decide whether your definition of "number of days" includes the last day, and add 1 if it does.
  • Result formatted as a date. A five-digit number like 45918 is a valid day count shown in date format. Change the number format rather than assuming the formula is wrong.
  • US versus local date order. Typing 03/04/2026 is ambiguous. Excel interprets it according to your regional settings, so 3 April can become 4 March and your answer is off by a month. Use unambiguous formats when sharing files, or enter dates via cells you control.
  • Negative results. If the end date is earlier than the start date, subtraction gives a negative number and NETWORKDAYS returns #NUM!. Wrap the formula in ABS() if you only care about the gap, or swap the dates.
  • Forgetting holidays in NETWORKDAYS. The function knows weekends but not public holidays unless you supply the holiday range.

Tips

  • Name your holiday list range (Formulas > Define Name) and refer to the name in NETWORKDAYS so the formula stays readable.
  • For a six-day week, use NETWORKDAYS.INTL with a weekend code, for example =NETWORKDAYS.INTL(A2,B2,11) where 11 means Sunday only. The codes are listed in Excel's help for the function.
  • For a plain day count without skipping weekends, =DAYS(B2,A2) does the same job as subtraction and reads more clearly on a shared sheet.
  • Format result cells as Number with zero decimals so day counts never inherit leftover date formatting when you paste.
  • Wrap calculations in IFERROR to keep a clean sheet: =IFERROR(B2-A2,"") hides errors in rows where a date is missing.
  • Use absolute references, such as $F$2:$F$12, for the holiday range so it does not shift when you copy the formula down.

Troubleshooting

If you get #VALUE!, suspect text dates first. Select the cell, look at the alignment, then run Data > Text to Columns and click Finish, which forces Excel to re-read the entry. If the result is a strange small number such as 0 or 1, your dates may be in the same cell or one may be empty.

If the result shows a date, change the number format to General. If NETWORKDAYS returns #NUM!, the start date is after the end date. If the total looks one day short, remember that plain subtraction excludes the final day and add 1.

If the formula breaks when copied, check for missing dollar signs on fixed ranges. If a shared workbook shows different answers for different people, the cause is usually regional date settings; switch to a consistent date entry method or use the DATE function, for example =DATE(2026,4,11)-DATE(2026,4,1), which is immune to regional interpretation. And if a formula stops updating, check that calculation is set to Automatic under Formulas > Calculation Options.

Frequently Asked Questions

Why does my formula return a date instead of a number?

The cell inherited a date format. Select it and set the number format to General or Number. The underlying value is already the correct day count.

Does subtracting dates include the end date?

No. B2-A2 counts the days between the dates, not both endpoints. Add 1 if you need an inclusive count.

How do I count only Monday to Friday?

Use =NETWORKDAYS(A2,B2). Add a range of holiday dates as a third argument to exclude public holidays as well.

What is the difference between DATEDIF and subtraction?

Both return a day count. DATEDIF is more flexible because it also returns whole months and years, but it errors if the start date is later than the end date.

Can I count days from today automatically?

Yes. Use =TODAY()-A2, which recalculates each time the sheet opens. For days remaining until a deadline, use =B2-TODAY().

Why does my result look negative?

The end date is earlier than the start date. Swap the cells, or wrap the formula in ABS() if you only need the size of the gap.