To calculate the duration between two dates in Excel, the fastest method is to subtract the start date from the end date using a simple subtraction formula: =End_Date - Start_Date. Because Excel stores dates as sequential serial numbers, subtracting one from another yields the total number of days between them. For more complex durations—such as calculating only working days or breaking the difference down into years, months, and days—you can use the DATEDIF function or the NETWORKDAYS function.

What You'll Need

  • Microsoft Excel (any modern version, including Excel 365, 2021, 2019, or Excel for the Web).
  • A dataset containing at least two columns of dates.
  • Dates entered in a format that Excel recognizes as a date (e.g., MM/DD/YYYY or DD-MMM-YYYY) rather than as plain text.

Step-by-Step

Method 1: Simple Subtraction (Total Days)

Use this method when you only need the total count of calendar days between two points in time.

  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. If the result appears as a date (e.g., 1/15/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 DATEDIF (Years, Months, or Days)

The DATEDIF function is a "hidden" function in Excel; it won't appear in the formula autocomplete list, but it is fully functional. It is the best way to get a specific unit of time.

  1. Select the cell for your result.
  2. Type =DATEDIF(A2, B2, "unit"), replacing A2 with the start date and B2 with the end date.
  3. Replace "unit" with one of the following codes based on your needs:
    • "d": Total days between the dates.
    • "m": Total complete months between the dates.
    • "y": Total complete years between the dates.
    • "md": The difference between the days in start_date and end_date, ignoring months and years.
    • "ym": The difference between the months in start_date and end_date, ignoring days and years.
    • "yd": The difference between the days of start_date and end_date, ignoring years.
  4. Press Enter to see the result.

Method 3: Calculating Working Days Only

If you need to exclude weekends and public holidays, the NETWORKDAYS function is the correct tool.

  1. List your start date in A2 and end date in B2.
  2. (Optional) Create a separate list of holiday dates in a range of cells (e.g., E2:E10) to ensure they are also excluded.
  3. In the result cell, type =NETWORKDAYS(A2, B2, E2:E10).
  4. Press Enter. Excel will calculate the number of Monday-through-Friday days between the two dates, minus any dates listed in your holiday range.

Method 4: Creating a "Human-Readable" Duration String

To create a result like "2 Years, 3 Months, 5 Days," you must combine multiple DATEDIF functions using the concatenation operator (&).

  1. Use the following complex formula (assuming A2 is start and B2 is end):
    =DATEDIF(A2,B2,"y") & " Years, " & DATEDIF(A2,B2,"ym") & " Months, " & DATEDIF(A2,B2,"md") & " Days"
  2. Press Enter. This formula calculates the years, then the remaining months, then the remaining days, and joins them into a single text string.

Common Mistakes

One of the most frequent errors is the Incorrect Date Order. In the DATEDIF and NETWORKDAYS functions, the start date must always come before the end date. If the start date is later than the end date, Excel will return a #NUM! error. Always double-check that your chronological order is correct within the parentheses.

Another common issue is Text-Formatted Dates. Sometimes dates are imported from other software as text. If a date is left-aligned in a cell by default, Excel likely sees it as text. In this case, subtraction formulas will return a #VALUE! error because you cannot perform math on a text string. You can fix this by using the "Text to Columns" feature under the Data tab to convert the column back to Date format.

Users also frequently confuse NETWORKDAYS with NETWORKDAYS.INTL. The standard NETWORKDAYS function assumes Saturday and Sunday are the weekend. If you are working in a region or industry where the weekend falls on different days (e.g., Friday and Saturday), you must use NETWORKDAYS.INTL, which allows you to specify a weekend code.

Tips

To make your spreadsheets more dynamic, use Absolute Cell References when referencing a holiday list. Instead of E2:E10, use $E$2:$E$10. This allows you to drag the formula down a column without the holiday range shifting downward, which would otherwise lead to incorrect calculations for the rows below.

If you are calculating durations that include time (hours and minutes), simple subtraction still works, but the result will be a decimal. For example, 1.5 days equals 1 day and 12 hours. To display this properly, right-click the cell, select Format Cells, and choose a Custom format like [d] "days" h "hours" m "minutes". The square brackets around the "d" prevent the day count from resetting every 31 days.

For very large datasets, avoid using complex concatenated DATEDIF strings in thousands of rows, as this can slow down calculation speed. Instead, calculate years, months, and days in three separate helper columns and concatenate them only in a final summary column if necessary.

Troubleshooting

The result looks like a weird date (e.g., 1/05/1900)
This is the most common "problem." Excel thinks that because you are subtracting dates, you want the result to be a date. Change the cell format to "General" or "Number" via the Home tab to see the actual number of days.

The formula returns #VALUE!
This happens when one of the cells is not recognized as a date. Check for leading spaces or hidden characters. A quick way to test this is to use the formula =ISNUMBER(A2). If it returns FALSE, the cell is text. Use the Data > Text to Columns > Finish trick to force Excel to re-evaluate the cells as dates.

The formula returns #NUM!
This occurs specifically with DATEDIF when the start date is more recent than the end date. Swap the cell references in your formula so the earlier date is first.

The day count is off by one
Standard subtraction (End - Start) calculates the difference. For example, from Jan 1 to Jan 2 is 1 day. However, if you are calculating a project duration where both the start and end day count as full working days, you must add 1 to the result: =(B2-A2)+1.

Frequently Asked Questions

Can I calculate the duration between two times on the same day?

Yes. Use the same subtraction method (End Time - Start Time). Ensure the result cell is formatted as "Time" or a custom format like [h]:mm to avoid the time resetting after 24 hours.

Does DATEDIF count the start day?

No, DATEDIF calculates the number of complete intervals. If the start date is Jan 1 and the end date is Jan 31, "m" will return 0 because a full month has not yet elapsed. To include the start day, you usually add 1 to the result.

How do I calculate the duration between today and a future date?

Use the TODAY() function. For example: =B2-TODAY(). This will automatically update every time you open the spreadsheet to show the remaining days until the date in B2.

Is there a way to exclude only Sundays?

Yes, use the NETWORKDAYS.INTL function. The syntax is =NETWORKDAYS.INTL(start_date, end_date, 11). The number "11" is the specific code that tells Excel that only Sunday is a weekend.

Why is my date subtracting as a negative number?

This happens if your start date is later than your end date. If you want the absolute difference regardless of which date comes first, wrap your formula in the ABS function: =ABS(B2-A2).