Subtract dates - Microsoft Support (2024)

Excel for Microsoft 365 for Mac Excel 2021 for Mac Excel 2019 for Mac More...Less

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.

Copy the sample data

  1. Copy the following sample data to cell A1 on a blank sheet.

    Task

    Start date

    End date

    Duration

    Create Project Plan

    6/8/2011

    9/20/11

    Phase 1

    9/21/11

    6/2/2012

    Phase 2

    6/3/2012

    12/10/2014

    Phase 3

    12/11/2014

    4/20/2017

  2. Press Subtract dates - Microsoft Support (1)+ C .

  3. In the sheet, select cell A1, and then press Subtract dates - Microsoft Support (2)+ V .

Calculate the difference in days

Calculate the number of days between two dates

  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 Subtract dates - Microsoft Support (3).

    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. Do one of the following:

    • In Excel 2016 for Mac, on the Formulas tab, click Insert Function.

      Subtract dates - Microsoft Support (5)
  3. In the Formula Builder search box, type NETWORKDAYS.

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

  5. Under Arguments, click the box next to start_date, and then on the sheet, select cell B2 (6/8/2011)

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

  7. Leave the box next to 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 Subtract dates - Microsoft Support (6).

    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 number of months between two dates in the same year

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 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 and YEAR 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 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.

Subtract times

Show dates as days of the week

Insert and format the current date and time

Need more help?

Want more options?

Discover Community

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Subtract dates - Microsoft Support (7)

Microsoft 365 subscription benefits

Subtract dates - Microsoft Support (8)

Microsoft 365 training

Subtract dates - Microsoft Support (9)

Microsoft security

Subtract dates - Microsoft Support (10)

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Subtract dates - Microsoft Support (11)

Ask the Microsoft Community

Subtract dates - Microsoft Support (12)

Microsoft Tech Community

Subtract dates - Microsoft Support (2024)

References

Top Articles
Latest Posts
Article information

Author: Domingo Moore

Last Updated:

Views: 6416

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Domingo Moore

Birthday: 1997-05-20

Address: 6485 Kohler Route, Antonioton, VT 77375-0299

Phone: +3213869077934

Job: Sales Analyst

Hobby: Kayaking, Roller skating, Cabaret, Rugby, Homebrewing, Creative writing, amateur radio

Introduction: My name is Domingo Moore, I am a attractive, gorgeous, funny, jolly, spotless, nice, fantastic person who loves writing and wants to share my knowledge and understanding with you.