Microsoft KB Archive/214101

= Formulas that return the last or first day of a month =

Article ID: 214101

Article Last Modified on 1/24/2007

-

APPLIES TO


 * Microsoft Excel 2000 Standard Edition
 * Microsoft Excel 2002 Standard Edition
 * Microsoft Excel 97 Standard Edition
 * Microsoft Excel 2001 for Mac
 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q214101





SUMMARY
This article describes how to create a formula that returns the last or first day of the current month in Microsoft Excel.



MORE INFORMATION
You can use the EOMONTH function to return the last day of the current month. For example, the following formula

=EOMONTH(TODAY,0)

returns the last day of the current month. Because the second argument (the MONTHS argument) is 0 (zero), the function assumes that the month that you want to use is the current month. If the second argument is 1, the function returns the last day of the following month.

To find the first day of the following month, use the following EOMONTH function:

=EOMONTH(TODAY,0)+1

This function is part of the Analysis ToolPak add-in. If you do not click Tools, and then click Add-ins to install and enable the Analysis ToolPak add-in, the formula will return a #VALUE error. You will also receive a #NAME error if either of the function arguments is nonnumeric.

Additional query words: XL2000 xl2001 xl2002 xl98 xl97 XL

Keywords: kbhowto KB214101

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.