Family Encyclopedia >> Work

How to use Excel to calculate between dates

Why is it so difficult to calculate dates in your head? It feels like one of those things that should be easy, but the seven-day weeks, the months with an uneven number of days, and the occasional skipping years all conspire to wreak havoc on your math ability.

Don't believe me?

How many days are there between January 9, 2015 and June 12, 2017? If you can solve it in less than five seconds, then that's fine, you're clearly a genius. But if it takes longer than that, then consider yourself normal and stop struggling when Excel can do the hard work for you.

Calculation of the number of days between two dates

In your Excel sheet, put the two dates you want to calculate in two separate cells.

You now have several equations available to you. Highlight the cell where you want the answer to be, and enter one of the following (be sure to replace the cell addresses with your own locations):

  • Difference in days:=DATEDIF (D2, E2,”re”)
  • Difference in weeks:=DATEDIF (D2, E2,”re”) / 7
  • Difference in months:=DATEDIF (D2, E2,"meter")
  • Difference in years:=DATEDIF (D2, E2,”y”)

How to use Excel to calculate between dates

Note: With the exception of "weeks," these calculations only give the number of days, months, or years completed. They will not include partially completed periods.

Calculation of the accumulated time between two dates

We know how to calculate total time periods, but what if we want to calculate the total amount of elapsed time, such as days, months, and years?

We need to combine the above equations. Put the following in a cell's input box and press Enter.

  • =DATEDIF (D2, E2,”y”) &” years, “
    &DATEDIF (D2, E2,”ym”) &” months, “
    &DATEDIF (D2, E2,”Maryland”) &” days”

How to use Excel to calculate between dates

Note: Press Alt + Enter to add a new line and Ctrl + Shift + U to expand the box and see all the text.

Have you used Excel to calculate dates? What Other Useful Equations 3 Crazy Excel Formulas That Do Amazing Things 3 Crazy Excel Formulas That Do Amazing Things Conditional formatting formulas in Microsoft Excel can do amazing things. Here are some Excel formula productivity hacks. Read more do you know about? Let us know in the comments.