To calculate the number of days between two dates in Excel, the fastest method is to subtract the start date from the end date using a simple formula: =End_Date - Start_Date. Because Excel stores dates as sequential serial numbers, subtracting one from another provides the exact number of calendar days between them.

Depending on your goal, you may need the total calendar days, only business days (excluding weekends), or a breakdown of years, months, and days. This guide covers the three most effective ways to achieve these results.

What You'll Need

  • Microsoft Excel (any version)
  • Two cells containing valid dates formatted as "Date"

Step-by-Step

Method 1: Simple Subtraction (Total Calendar Days)

Use this method when you need the absolute number of days between two dates, regardless of holidays or weekends.

  1. Enter your start date in one cell (e.g., cell A2) and your end date in another (e.g., cell B2).
  2. Click on the cell where you want the result to appear (e.g., cell C2).
  3. Type the formula: =B2-A2 and press Enter.
  4. Important: If the result looks like a date (e.g., "January 5, 1900") instead of a number, go to the Home tab, locate the Number group, and change the dropdown menu from "Date" to "General" or "Number".

Method 2: Using the NETWORKDAYS Function (Business Days Only)

Use this method to calculate working days, automatically excluding Saturdays and Sundays.

  1. Enter your start date in cell A2 and your end date in cell B2.
  2. In cell C2, type the formula: =NETWORKDAYS(A2, B2) and press Enter.
  3. To exclude specific holidays, list those holiday dates in a separate range of cells (e.g., E2:E5).
  4. Update your formula to include that range: =NETWORKDAYS(A2, B2, E2:E5).

Method 3: Using the DATEDIF Function (Detailed Intervals)

The DATEDIF function is a "hidden" function in Excel; it won't appear in the formula autocomplete list, but it works perfectly for calculating the difference in specific units like months or years.

  1. Enter your start date in cell A2 and your end date in cell B2.
  2. In cell C2, type the formula based on the unit you need:
    • For total days: =DATEDIF(A2, B2, "d")
    • For total full months: =DATEDIF(A2, B2, "m")
    • For total full years: =DATEDIF(A2, B2, "y")
  3. Press Enter.

Common Mistakes

  • Wrong Date Order: In subtraction and DATEDIF, if you put the earlier date after the later date (e.g., =Start_Date - End_Date), Excel will return a negative number or a #NUM! error. Always subtract the older date from the newer date.
  • Incorrect Cell Formatting: The most common point of confusion is when Excel automatically formats the result cell as a "Date." If your result is "1/15/1900" instead of "15," you must change the cell format to "General."
  • Text vs. Date: If your dates are aligned to the left of the cell, Excel may be treating them as text. Formulas will return a #VALUE! error if the cell is not recognized as a numerical date.

Tips

  • Dynamic Dates: To calculate the days between a past date and today, use the TODAY function. For example: =TODAY()-A2. This will update every time you open the spreadsheet.
  • Inclusive Counting: Simple subtraction calculates the difference. If you need to include both the start and end day in your count (e.g., for a project duration), add 1 to your formula: =(B2-A2)+1.
  • Custom Weekends: If your "weekends" are not Saturday and Sunday, use =NETWORKDAYS.INTL(start_date, end_date, [weekend]). The [weekend] argument allows you to specify which days are non-working days using a numerical code.

Troubleshooting

If your formula is not working as expected, try these steps in order:

  1. Check for #VALUE! Error: This usually means one of your dates is actually text. Select the date cells, go to the Data tab, select Text to Columns, and click Finish immediately. This often forces Excel to re-recognize text as dates.
  2. Check for #NUM! Error: Ensure the start date is chronologically before the end date. DATEDIF cannot handle a start date that occurs after the end date.
  3. Verify Date Format: Ensure your dates are entered in a format your region recognizes (e.g., MM/DD/YYYY in the US vs DD/MM/YYYY in the UK). If you enter a date in a format Excel doesn't recognize, it treats it as a text string.
  4. Reset Cell Formatting: If the result looks like a random date or a series of hashtags (#######), go to the Home tab and change the number format to General.

Frequently Asked Questions

Why is my result a date instead of a number?

Excel sees that you are using dates in your formula and assumes you want the result to be a date too. Change the cell format to "General" or "Number" in the Home tab to see the actual count of days.

How do I count only weekdays?

Use the =NETWORKDAYS(start_date, end_date) function. This automatically removes all Saturdays and Sundays from the total.

Can I calculate the number of days between two dates in different years?

Yes. All the methods mentioned (subtraction, NETWORKDAYS, and DATEDIF) work across different years, months, and centuries.

What is the difference between subtraction and DATEDIF?

Subtraction gives you the total number of days. DATEDIF is more versatile, allowing you to isolate just the number of years or months that have passed, ignoring the remaining days.

How do I include holidays in my business day count?

Create a list of holiday dates in a separate column. In your NETWORKDAYS formula, add that range as the third argument: =NETWORKDAYS(A2, B2, E2:E10).