EDUCBA Logo

EDUCBA

MENUMENU
  • Explore
    • EDUCBA Pro
    • PRO Bundles
    • All Courses
    • All Specializations
  • Blog
  • Enterprise
  • Free Courses
  • All Courses
  • All Specializations
  • Log in
  • Sign Up
Home Excel Excel Resources Excel Tips Subtract Date in Excel
 

Subtract Date in Excel

Madhuri Thakur
Article byMadhuri Thakur

Updated June 8, 2023

Subtract Date in Excel

 

 

Excel Subtract Date (Table of Contents )

Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

  • Overview of Excel Subtract Date
  • Examples to Subtract Date in Excel

Overview of Excel Subtract Date

Working with dates in Excel is common for someone being a data analyst, isn’t it? You might have worked on a lot of those. However, while working with a large set of dates, the possible chances are that you may encounter a situation where you want to determine the difference between the two dates. Maybe you want to get the number of days between two date values. I might be interested in finding out the number of months that fall between those two dates or also being interested in years. It is an easy task at first when you look at it.

Examples to Subtract Date in Excel

This article will see how to subtract two dates based on certain criteria to get the desired result. Follow the article as well as the steps for each example below:

You can download this Subtract Date Excel Template here – Subtract Date Excel Template

Example #1 – Two Dates in a Number of Days

Consider data as shown below, where we have two columns named First Date and Second Date:

Subtract Date in Excel 1-1

Step 1: In cell C2, use a usual subtraction method to subtract the First Date from the Second Date. Use the formula as =B2-A2.

Subtract Date in Excel 1-2

Press the Enter key, and you’ll get the difference between the two dates as shown below:

Subtract Date in Excel 1-3

Step 2: Select the entire column C and click on the Home tab under the Number group section; select General or Number formatting through the dropdown list to convert it into numbers.

General - Subtract Date

You now can see the difference between the two dates as a number of days as shown below:

Subtract Date in Excel 1-4

Step 3: Drag the formula until the last working row, and you can see the difference between all dates in a number of days, as shown below. After selecting all the working cells, you can hit keyboard strokes Ctrl + D.

Subtract Date in Excel 1-5

Example #2 – Two Dates in Number of Years

Now, we will be looking to figure out how to find a difference between two dates in a number of years.

Since we need to determine the difference between the years of the Second Date and the First Date, we’ll use the YEAR() function in Excel to determine the difference in years.

Step 1: In cell D2, use the =YEAR(B2) formula. It will extract the year from the date present under cell B2.

year substract 2-1

Step 2: Now, use the subtract operator to subtract between two date years.

year substract 2-2

Step 3: Again, use YEAR(A2) to extract the year from the date present under cell A2.

Substract Excel 2-2

Press Enter key, and you’ll get the number of years as a difference between Second Date and First Date, as shown below.

year substract 2-3

Step 4: Drag the formula across cells to get the difference in the number of years for dates present across the cells.

year substract 2-4

If you can see column D, you will figure out that for rows 4 and 7, the number of years difference is zero. Since both the dates are associated with falling in the same year, with getting a fraction of the year value, we can use the other function called YEARFRAC() to get the number of years, including a fraction of the years well.

Year in Fraction 3-1

In cell E2, use =YEARFRAC(A2, B2) as a formula to get the year value with the fractional part included in it.

Note that the YEARFRAC function has three parameters, start_date is the First Date, and end_date is the Second Date. These two parameters are required arguments and need to be provided. The third parameter is [basis], which is optional.

Year in Fraction 3-2

Now, drag the formula until cell E11; you can see all the differences in fractional years. Pay more attention to rows 4 and 7; you will not see zero there.

Year in Fraction 3-3

Example #3 – Two Dates using DATEDIF Function

We are about to see a function not listed in any of the Excel formulas. In cell F2, use the formula for DATEDIF and initiate the formula for the same.

Step 1: Use A2 as a first argument (start_date) and B2 as a second argument (end_date) under the DATEDIF formula.

DATEDIF function 3-1

Step 2: For the third argument (unit), use either of the units available to get the difference in the desired format. I will use M to get the difference in the number of months.

DATEDIF function 3-2

Please look at the double quotes we have added for unit value. Enclosing the value for the unit argument in double quotes is mandatory to get the formula working.

Step 3: Drag the formula until cell F11 to get the desired result as a difference between the number of months for given dates.

DATEDIF function 3-3

We subtract two dates in Excel to determine the number of days, years, or months. Let’s wrap things up with some points to be remembered:

Things to Remember

  • The DATEDIF function is not a part of any of the Excel formulas. However, it can use within Excel.
  • Ensure that while using the YEARFRAC and DATEDIF functions, the end_date should always be greater than the start_date. Otherwise, you’ll be encountered with #NUM! Error.
  • The unit “M” extract the number of complete months between two date values. The same is with unit “Y” which returns the year between two dates.

Recommended Articles

This has been a guide to Subtract Dates in Excel. Here we discuss How to Subtract Dates in Excel, practical examples, and a downloadable Excel template. You can also go through our other suggested articles –

  1. Excel Subtract Time
  2. Compare Dates in Excel
  3. Excel Date Format
  4. Subtraction in Excel
Primary Sidebar
Footer
Follow us!
  • EDUCBA FacebookEDUCBA TwitterEDUCBA LinkedINEDUCBA Instagram
  • EDUCBA YoutubeEDUCBA CourseraEDUCBA Udemy
APPS
EDUCBA Android AppEDUCBA iOS App
Blog
  • Blog
  • Free Tutorials
  • About us
  • Contact us
  • Log in
Courses
  • Enterprise Solutions
  • Free Courses
  • Explore Programs
  • All Courses
  • All in One Bundles
  • Sign up
Email
  • [email protected]

ISO 10004:2018 & ISO 9001:2015 Certified

© 2025 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

EDUCBA
Free Excel Course

Excel functions, formula, charts, formatting creating excel dashboard & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

Download Subtract Date Excel Template

EDUCBA Login

Forgot Password?

EDUCBA

Download Subtract Date Excel Template

EDUCBA

डाउनलोड Subtract Date Excel Template

🚀 Limited Time Offer! - 🎁 ENROLL NOW