• 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
  • 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:  How to Convert Time to Minutes in Excel

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

Ways to Use Excel Mobile - TATFI
10 Creative Ways to Use Excel Mobile in your Business
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

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!

Amazfit Falcon Smartwatch - TATFI

The Amazfit Falcon is a Military Grade Smartwatch with Premium Looks and Great Features

Couchmaster Cyboss Ergonomic Couch Desk - TATFI

Couchmaster Cyboss is an Ergonomic Desk to Keep Off Neck Pain

Philips Hue Festavia String Lights - TATFI

Add a Bit of Sparkle to Your Christmas Tree with Philips Hue Festavia String Lights

Samsung Galaxy Tab A7 Lite Kids Edition - TATFI

This Kid Friendly Tablet from AT&T is a Thoughtful Gift for Your Little One This Christmas

Is An iPhone Really Worth It - TATFI

Is an iPhone is Really Worth It?

Devices You Might Want to Try - TATFI

4 Fantastic Devices You Might Want to Try

Amazon Kindle 2022 - TATFI

Meet the Amazon Kindle 2022 – Packed with New Features

Popular Tags

android android apps android games android how to apple casino games 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 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.
Make Money Playing at Fairspin Online Casino - TATFI

Make Money Playing at Fairspin Online Casino

How Mobile Wellbeing Apps are Empowering Patients - TATFI

How Mobile Wellbeing Apps are Empowering Patients

Tips to Boost Your Ranking and Sales on Etsy - TATFI

5 Ways to Boost Your Ranking and Sales on Etsy

PunchBee Time Management App - TATFI

Know How You Spend Your Time with PunchBee

DevOps Model Explained - TATFI

The Complete Guide to DevOps: How the Model Works and Who It Benefits

Approaches to Digital Marketing - TATFI

Blending Technical and Content-Centric Approaches to Digital Marketing

Tech Tips For Startups - TATFI

Useful Tech Tips For Startups

Boox Tab X Android eReader - TATFI

Boox Tab X is an Android eReader That Helps You Do More Than Just Read

Best e Readers to Buy in 2023 - TATFI

5 Best eReaders to Buy in 2023

Best Translation Apps for Android - TATFI

5 Great Translation Apps for Android

Dynamic Island Feature on Your Android - TATFI

How to Get the Dynamic Island Feature on Android

Connected TV Advertising In 2023 - TATFI

5 Things You Need To Know About Connected TV Advertising In 2023

TheAppTimes © 2023 // Runs on StudioPress