• About
  • Contact
  • Privacy Policy
  • Submit For Review
  • Template Gallery
  • Excel 2016 Udemy Course
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

TheAppTimes

App Reviews, Tutorials, & Gadget News Hub

  • Gadgets
  • How To
  • Mobile Apps
  • Software and Web Apps
  • Buying Guides
  • Shop
  • Show Search
Hide Search
Home » How To » How to Calculate Number of Days Between Two Dates in Excel

How to Calculate Number of Days Between Two Dates in Excel

October 27, 2016

In a previous post, I showed you how to use the NETWORKDAYS() function in Excel to calculate the number of work days between two dates in Excel. In today’s post we’ll take a look at how you can use further Excel functions to calculate number of days between two dates in Excel. We’ll also see how to calculate the number of weeks, months and years between two dates in Excel also.

For the purpose of doing this computation, we make use of the DATEDIF function. This function is actually an unlisted function in Excel, so if you were to search for the function in your Insert Function dialog, you won’t find it. Nevertheless, its an easy function to use once you know its arguments.

DATEDIF Parameters

For the purpose of computing the difference in days, weeks, months, or years, you need the start date, the end date and the parameter that tells Excel what you want to extract. So, here are the different parameters:

m = months. It extracts the whole calendar months between the specified dates.

d = days. It extracts the number of days between the specified dates.

y = years. It extracts the whole calendar years between the specified dates.

ym = months excluding years. It extracts the whole calendar months between the specified dates treating them as if they were from the same year.

yd = days excluding years. It extracts the whole calendar days between the dates treating them as if they were from the same year.

md = days excluding years and months. It extracts the whole calendar days between the dates treating them as if they were from the same month and year.

Let’s get started, shall we?

How to Calculate Number of Days Between Two Dates in Excel

In cell A2, we have a Start date 2-Oct-78 and in cell B2 we have an end date 27-Oct-16. To calculate the number of days between the two days, we can simply make use of the subtraction formula to get the result.

So in cell A3, if I compute End date minus Start date. I’ll get the difference in days. So my formula will be =B2-A2 which gives the result of 13905 days.

How to Calculate Number of Days Between Two Dates in Excel

I can also use the DATEDIF function to get the result.

ALSO READ:  Excel 2010: How to Add and Delete Rows and Columns

In cell A3 type =DATEDIF(A2,B2,”d”) which also gives the result of 13905 days.

how-to-calculate-number-of-days-between-two-dates-in-excel-using-datedif

How to Calculate Number of Weeks Between Two Dates in Excel

Computing the number of weeks between two days requires a different approach. Here, you want to subtract the end date from the start date and divide it by 7 ( number of days in the week) to get the net result.

In cell D2, type =(B2-A2)/7 which gives the result of 1986.428571 weeks.

how-to-calculate-number-of-weeks-between-two-dates-in-excel

If you want only whole weeks, you can use the INT function. In this case, the formula will read =INT((B2-A2)/7)

calculate-weeks-in-whole-number

How to Calculate Number of Months Between Two Dates in Excel

Using the same dates as in the previous example, let’s compute the number of months between two dates in Excel. For this we can again used the DATEDIF formula with the parameter “m”

In cell E2, we enter the function =DATEDIF(A2,B2,”m”) which will give the result of 456 weeks.

how-to-calculate-number-of-months-between-two-dates-in-excel

How to Calculate Number of Years Between Two Dates in Excel

To calculate the number of years between two dates in Excel, we can use the YEAR function, which returns the year of the date. We extract the year of the first date and the year of the second date and subtract the two to get the difference in years.

In cell F2, we enter the formula =YEAR(B2)-YEAR(A2)

This will return the value in years, which is 38.

how-to-calculate-number-of-years-between-two-dates-in-excel

You can also use the DATEIF function for this.

In cell F2, type =DATEDIF(A2,B2,”y”) which will give the result of 38 weeks.

how-to-calculate-number-of-years-between-two-dates-in-excel-using-datedif

One point to remember when using the DATEDIF function is that it returns only the number of complete days, months or years. This may sometimes give inaccurate results especially when the day/month number of the second date is lower than the day/month number of the first date. So use with caution.

If you found this tutorial helpful, be sure to read all our tutorials in the Learn Excel series. If you want to learn Excel from scratch, consider taking up our Udemy course, Excel 2016 for Beginners, which is available at a nominal price of just $10.

Tweet12
Share3
WhatsApp
Pin4
Buffer
19 Shares

Filed Under: How To Tagged With: excel how to, learn excel

You May Also Like

How to Get Rid of the Paste Options Menu in Word, Excel and PPT
How to Get Rid of the Paste Options Menu in Word, Excel and PPT
How to Combine Text with a Date or Time in Excel
How to Combine Text with a Date or Time in Excel
How to Hide Data in a Worksheet in Excel
How to Hide Data in a Worksheet in Excel

About Adeline Gear

Adeline is a tech enthusiast who loves exploring the latest tools and applications in the marketplace. She also loves her Android and spends time reviewing apps and playing games when she has the time.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Hottest New Gadgets!

Samsung Galaxy SmartTag Bluetooth Tracker - TATFI

Find Lost Items with the Samsung Galaxy SmartTag Bluetooth Tracker

Fantastic Board Games - TATFI

Fantastic Board Games to Play This Holiday Season

MagSafe Duo Charger - TATFI

Charge Your iPhone and Apple Watch at the same time with MagSafe Duo Charger

Polar Unite Tracker - TATFI

Want a New Affordable Fitness Watch with Built in GPS? Check out the Polar Unite

Gadgets To Play Online Casino - TATFI

Must-Have Gadgets To Play Online Casino

Popular Tags

android android apps android games android how to apple chrome extensions excel excel how to facebook gadgets gaming gmail google instagram ios apps ios games ios how to ios tips ipad iphone kids apps learn excel management microsoft music apps new releases outlook how to photo apps powerpoint powerpoint how to productivity Samsung security smartphone smartphones software tablet tablets technology twitter web browsers windows 10 word how to xbox youtube

Disclosure

TheAppTimes is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.

TheAppTimes © 2021 // Runs on StudioPress