Subtract dates in Excel 2016 for Mac

You can quickly find the difference between two dates, control the format of the result, and extend the calculation to a list of dates. For example, you can quickly subtract one date from another date, or calculate the duration of items on a project schedule.

Use the provided sample data and the following procedures to learn how to calculate dates in a project schedule.

Recreate the sample data

To better understand the steps, type in the following sample data, starting in cell A1 on a blank sheet.

  1. Create a blank workbook or sheet.

  2. Select the following sample data.

    Task

    Start date

    End date

    Duration

    Create Project Plan

    6/8/2015

    9/20/15

    Phase 1

    9/21/15

    6/2/2016

    Phase 2

    6/3/2016

    12/10/2018

    Phase 3

    12/11/2018

    4/20/2021

  3. Press COMMAND + C .

  4. In the sheet, select cell A1, and then press COMMAND + V .

Calculate the difference in days

  1. Select cell D2, which is the first blank cell in the Duration column.

  2. Type =C2-B2, and then press RETURN .

    Excel displays the result as the number of days between the two dates (104).

  3. Select cell D2.

  4. To copy the formula into the remaining rows, drag the fill handle   Fill handle .

    Excel adjusts the cell references automatically to include the correct values for each row.

Calculate the number of workdays between two dates

  1. Select cell D2, which is the first blank cell in the Duration column.

    If the cell is not blank, on the Edit menu, point to Clear, and then click All.

  2. On the Formulas tab, select Insert Function to open the Formula Builder.

    On the Formulas menu, select Insert Function

  3. In the Formula Builder search box, type NETWORKDAYS.

  4. In the list that appears, double-click NETWORKDAYS.

  5. Click the box below start_date, and then on the sheet, select cell B2 (6/8/2015)

  6. Under Arguments, click the box below end_date, and then on the sheet, select cell C2 (9/20/2015)

  7. Leave the box below holidays blank.

  8. Press RETURN.

    The result is 75 working days, not accounting for holidays.

  9. Select cell D2.

  10. To copy the formula into the remaining rows, drag the fill handle   Fill handle .

    Excel adjusts the cell references automatically to include the correct values for each row.

    Tip: See NETWORKDAYS function and NETWORKDAYS.INTL function to learn more about these formulas, including how to account for holidays.

Calculate the difference in months or years

Excel treats months as values (1 through 12), which makes it easy to subtract an earlier date from another date as long as both dates fall in the same year. Use the MONTH function function to obtain the month value for each date, and then calculate the difference between the values.

  1. Select cell D2, which is the first blank cell in the Duration column.

    If the cell is not blank, on the Edit menu, point to Clear, and then click All.

  2. In cell D2, type =MONTH(C2)-MONTH(B2), and then press RETURN .

    The result is 3.

Calculate the number of months between two dates in different years

When you have to find the number of months between dates that fall in different years, you can use a formula that determines the number of years between the two dates, converts the difference in years to months, and then accounts for any additional months to obtain an accurate result. Use the MONTH function and YEAR function functions to make this calculation.

  1. Select cell D3.

    If the cell is not blank, on the Edit menu, point to Clear, and then click All.

  2. In cell D3, type =(YEAR(C3)-YEAR(B3))*12+MONTH(C3)-MONTH(B3), and then press RETURN .

    The result is 9.

Calculate the number of years between two dates

Excel treats years as values. Use the YEAR function function to obtain the year value for each date, and then calculate the difference between the values.

  1. Select cell D4.

    If the cell is not blank, on the Edit menu, point to Clear, and then click All.

  2. In cell D4, type =YEAR(C4)-YEAR(B4) and then press RETURN .

    The result is 2.

See Also

Display dates, times, currency, fractions, or percentages

Share Facebook Facebook Twitter Twitter Email Email

Was this information helpful?

Great! Any other feedback?

How can we improve it?

Thank you for your feedback!

×