Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. 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: Using the EOMONTH Function.
by Allen Wyatt
(last updated April 6, 2021)
The EOMONTH function is used to return the serial number value for the last day of any particular month, past, present, or future. The syntax for the function is as follows:
The base value is a date from which the function should do its calculations, and the offset is a number that indicates how many months from the base date should be used. For instance, an offset of 0 would indicate that EOMONTH should return the last day of the month represented in base, whereas an offset of 4 would be four months after base, and –2 would be two months before.
As an example, the following are typical uses of EOMONTH. The first line can be used to return the last day of the current month, and the second line returns the last day of the month six months later than the date in A1:
Remember that EOMONTH returns a serial number. Excel does not automatically format the serial number as a date. In other words, you will need to explicitly format the cell as a date.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12156) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Using the EOMONTH Function.
Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!
Need to find the absolute value of a number? That's where the ABS function comes into play.Discover More
The process of combining string (text) values to make a new string is called concatenation. Excel provides the ...Discover More
Need to find the lowest numbers in a range of values? It's easy to do using the SMALL worksheet function, or you can use ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.