Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Leap Years and Fiscal Periods.

Leap Years and Fiscal Periods

Written by Allen Wyatt (last updated December 9, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


1

A company's fiscal year can end at any time, not just when a calendar year ends. When putting together a worksheet, you may want to calculate a date that is one year before or after a given date that represents the end of a fiscal period. This can be done quite easily with any number of formulas, such as the following:

=DATE(YEAR(D1)-1, MONTH(D1), DAY(D1))

This formula takes a date (cell D1) and subtracts a year from it. Thus, if D1 contains the date 3/31/18, then the formula returns 3/31/17.

This works great in most instances because most months have the same number of days from one year to the next. There is, of course, one exception—February. If you have a fiscal year that ends in February, the variable number of days in the month can play havoc with the above formula. If cell D1 contains 2/28/17, then the formula returns 2/28/16, when the real end of the fiscal period is 2/29/16. Similarly, if cell D1 contains 2/29/16, then the formula returns 3/1/15, which is obviously not what was intended.

There are a couple of ways you can determine the end of the fiscal period. The first is through the use of the EOMONTH function. This function is used to return the end of a month a given number of months in the past or future. For instance, if you wanted to know the last day of the month twelve months ago, you can use the following formula:

=EOMONTH(D1,-12)

You are not tied to use EOMONTH, however. You could also use a formula such as the following:

=DATE(YEAR(D1)-1, MONTH(D1)+1, 0)

This formula, just like the EOMONTH function, returns the end of the month for exactly one year ago. Another formula to return the end of month one year ago is as follows:

=D1-365-(DAY(D1)<>DAY(D1-365))

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12594) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Leap Years and Fiscal Periods.

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

Word Count for a Section

Dynamic word counts for your entire document are easy to get when you use using fields. There is no built-in method to ...

Discover More

Viewing Footnotes

Adding footnotes to a document is essential for some types of writing. How you view those footnotes depends on the ...

Discover More

Putting Style Names Next to Paragraphs on a Printout

If you use styles to format your document, you might want a way to print the document and show, to the left of each ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Using a Text Function with a Date/Time Returns an Error

If you use a text function with a date or time, you'll get an error. To understand why this occurs (and how to get around ...

Discover More

Generating a 4 On/4 Off Work Schedule

You can use Excel to work with times and dates. Sometimes, however, figuring out the best way to do that can be tricky. ...

Discover More

Tombstone Date Math

Doing math with dates is easy in Excel. Doing math with old dates, such as those you routinely encounter in genealogy, is ...

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}] (all 7 characters, in the sequence shown) 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 6 + 5?

2023-12-09 10:33:52

Edwin B Shown

I took the leap year formula and made it into a lambda function. Its a nice way to shorten formulas.


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.