Categories: Microsoft Excel

How To Calculate The Difference Between Two Dates in Excel

We require calculating the difference between two dates for many purposes in our daily life. Excel consists of many functions that easily calculate the difference between two dates.

Mostly this difference is required for Payroll purposes for calculating the number of days worked in a month for preparing salaries.

In Accounting, it is required for knowing due dates of payments and in HR for employee benefits.

You can use the DATEDIF function to easily calculate the difference between two dates. With this function, you can calculate the difference in days, weeks,  months and years.

Let us understand it with an example.

Copy below data in your worksheet and copy it in 2 times.

Start Date              End Date

5/4/2015                4/3/2017

Note: Please make sure that the format of the cell is set to date format.

In C1 put the heading Difference. In C2 put an equal sign and insert the DATEDIF Function. The DATEDIF function has  3 arguments in the syntax.

=DATEDIF(Start_Date, End_Date, Unit)

You can either put the dates directly in the formula or use cell reference. Choose the desired unit. “Y” for the year, “M” for the month and “D” for days.

1. Finding the difference in Number of days

Formula with Dates: =DATEDIF(5/4/2015, 4/3/2017, “D”).

OR

Formula with Cell Reference: =DATEDIF(A2,B2, “D”)

The result will be 700 days. To calculate the difference in weeks, just divide the whole formula with 7. =DATEDIF(A2, B2, “D”)/7

2. Finding the difference in Months

Formula with Dates: =DATEDIF(5/4/2015, 4/3/2017, “M”).

OR

Formula with Cell Reference: =DATEDIF(A2,B2, “M”).

Here you get the result as 22 months.

3. Finding the difference in Years

Formula with Dates: =DATEDIF(5/4/2015, 4/3/2017, “Y”).

OR

Formula with Cell Reference: =DATEDIF(A2,B2, “Y”).

You get the result as 1 year. This function counts the number of full years between the dates. This is how you can use the DATEDIF function to calculate the difference between two dates

To learn other functions like MID, QUOTIENT and KURT Functions, please click on the name of the function.

We thank our readers for liking, sharing and following us on different social media platforms.

If you have any queries please share in the comment section below. I will be more than happy to assist you.

Shabbir Bhimani

I have worked in Excel and like to share functional excel templates at ExcelDataPro.

Share
Published by
Shabbir Bhimani

Recent Posts

Download UK VAT Taxable Turnover Calculator Excel Template

To simplify the process, we have created a simple and easy UK VAT Taxable Turnover…

4 years ago

Step By Step Guide TO UK VAT Registration Process

Every business has to register for VAT with HM Revenue and Customs if their VAT…

4 years ago

Download UK VAT Dual Currency Invoice Excel Template

We have created the UK VAT Dual Currency Invoice excel template with predefined formulas that…

4 years ago

Download UK VAT Purchase Register Excel Template

We have created a simple and easy UK VAT Purchase Register Excel Template with predefined…

4 years ago

Download UK VAT Sales Register Excel Template

We have created a simple and easy UK VAT Sales Register Excel Template with predefined…

4 years ago

Download UK VAT Progress Billing Invoice Excel Template

We have created a ready to use UK VAT Progress Billing Invoice template in excel…

4 years ago