bottom
Great ExcelTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > ExcelTips Home > Worksheet Functions > Date and Time Functions > Using the EOMONTH Function

Using the EOMONTH Function

Summary: The EOMONTH function returns the last day of a month you specify, either in the future or in the past. The function is easy to use and can be very helpful when working with dates. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, and Excel 2003.)

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:

=EOMONTH(base, offset)

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:

=EMONTH(NOW(),0)
=EMONTH(A1,6)

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. (Just select Cells from the Format menu and you can do all the formatting you want.)

The EOMONTH function is a part of the Analysis Toolpak. If you get an error when you try to use the function, you can make sure the toolpak is loaded in this manner:

  1. Choose Add-Ins from the Tools menu. Excel displays the Add-Ins dialog box. (Click here to see a related figure.)
  2. Make sure the Analysis Toolpak check box is selected.
  3. Click on OK.

Tip #2810 applies to Microsoft Excel versions: 97 | 2000 | 2002 | 2003


PivotTables Got You Perplexed? PivotTables for the Faint of Heart shows how you can start using Excel's PivotTable tool right away to spin your data into gold! You discover how easy it really is to crunch the numbers you need to crunch. Uncover the power of creating PivotTables, editing them, formatting them, customizing them, and much more.
 
Check out PivotTables for the Faint of Heart today!

Helpful Links

Ask an Excel Question
Make a Comment

Tips.Net Home

ExcelTips FAQ
ExcelTips Premium

Learn Access Now

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Word2007 Tips
WordTips

Advertise on the
ExcelTips Site

 

Great Info!

Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)