XL: Formulas that Return the Last or First Day of a MonthLast reviewed: February 2, 1998Article ID: Q94662 |
The information in this article applies to:
SUMMARYTo create a formula that returns the last or first day of the current month, follow the appropriate procedure below.
MORE INFORMATION
Microsoft Excel Version 4.0 or LaterIn Microsoft Excel 4.0 or later, 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 you want to use is the current month. If the second argument is one (1), the function will return the last day of the following month. To find the first day of the following month, use the EOMONTH function as follows:
=EOMONTH(TODAY(),0)+1 Microsoft Excel Version 3.0 or EarlierTo return the last day of the current month, use the following formula:
=DATE(YEAR(NOW()),MONTH(NOW())+1,1)-1To find the first day of the following month, use the following formula:
=DATE(YEAR(NOW()),MONTH(NOW())+1,1)For more information about the EOMONTH function, see pages 133-134 of the version 4.0 "Microsoft Excel Function Reference."
REFERENCES"Microsoft Excel Function Reference," version 4.0, pages 133-134 "Microsoft Excel Function Reference," version 3.0, pages 44-45, 161 and 251-252 "Microsoft Excel Functions and Macros," version 2.2 for the Macintosh, pages 31-32, 33-34, 66-67 "Microsoft Excel Functions and Macros," version 2.0 for Windows, pages 39-41, 91-92, and 126-127
|
Additional query words: 2.0 2.00 2.01 2.1 2.10 2.2 2.20 2.21 3.0 3.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |