Including Weeks in Elapsed Time

by Allen Wyatt
(last updated May 6, 2019)

Sally needs a formula that will return the number of years, months, weeks, and days that have elapsed since a beginning date. She's been able to find a formula that shows years, months, and days, but the inclusion of weeks is something that has eluded her for some time.

If Sally needed to only find the number of days or weeks or months or years between two dates, the math is rather simple. (Just calculate the number of days and divide by the appropriate average number of days in the week, month, or year.) That is not what she wants, however. She wants to know an answer that shows the number of elapsed years, months, weeks, and days between two dates.

Thus, if the starting date was June 10, 1966, and the ending date was February 5, 2019, then the answer she seeks would be "52 years, 7 months, 3 weeks, and 5 days." If the ending date is changed to February 7, 2019, then the answer would be "52 years, 7 months, 4 weeks, and 0 days." In this answer, each progressively granular date gradation functions only on the remainder of the preceding parts of the answer.

The formula to which Sally refers—which does not include an indicator for weeks—can be found at this page on the ExcelTips site:

http://excelribbon.tips.net/T011360

That tip shows several different formulas to arrive at a desired result, most relying on the DATEDIF function. (It doesn't make sense to recreate, on this page, the extensive information provided on the other ExcelTips page. You may want to go take a look at it, however.)

If adding weeks into the mix, the basic idea is to simply use the same DATEDIF approach, show the number of weeks, and adjust the number of days to take those weeks into account, in this manner:

=DATEDIF(A1,B1,"y") & " years, " & DATEDIF(A1,B1,"ym")
& " months, " & INT(DATEDIF(A1,B1,"md")/7) & " weeks, "
& MOD(DATEDIF(A1,B1,"md"),7) & " days"

This is essentially a modified version of the first full DATEDIF formula on the other ExcelTips page, referenced above. It doesn't take grammar and punctuation into account (as do the later formulas on the page), but it provides the desired information. It is a relatively simple extension of this base formula to get the grammar and punctuation correct.

This formula relies on A1 containing the starting date and B1 containing the ending date (the ending date could easily be set to today's date).

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12947) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Saving Versions

If you need to save your Excel data at different benchmarks, you might want to use some sort of "versioning" system. Such ...

Discover More

Incrementing References by Multiples when Copying Formulas

You can easily set up a formula to perform some calculation on a range of cells. When you copy that formula, the copied ...

Discover More

Copying Print Areas when Copying Worksheets

Print areas are a great way to define what, exactly, you want to print from a worksheet. When you copy worksheets, the ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

ISO Week Numbers in Excel

Work in an industry that uses ISO standards when it comes to working with dates? You'll love the formula in this tip ...

Discover More

Calculating a Sum for a Range of Dates

If you use Excel to track information based on dates, you may wonder how to get a sum for only certain dates that you ...

Discover More

Determining If a Year is a Leap Year

Need to figure out if a given year is a leap year? It's not as easy as you think! This tip provides a plethora of ways ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is nine more than 2?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.