# of days in month
Returns the number of days in a month for the current year.
If all you have is the month name (as a TEXT entry) in either long or short
form:
A1 = July or Jul
=DAY(DATE(YEAR(A1&1),MONTH(A1&1)+1,0))
If all you have is the month number:
A1 = 7
=DAY(DATE(YEAR(TODAY()),A1+1,0))
If you have any date for that month (with a specific year):
A1 = 7/22/2007
=DAY(DATE(YEAR(A1),MONTH(A1)+1,0))
--
Biff
Microsoft Excel MVP
"Dave Thomas" wrote in message
. net...
You can also use the following. If A1 contains a date, then the number of
days in the month represented by the date is given by:
=DAY(EOMONTH(A1,0)) In this example the EOMONTH function adds 0 to the
month of the date in A1 and calculates the date of the last day of the
month. Then the DAY function returns the day number (1-31) of that date.
Note: You must have the Analysis Toolpack add-in installed in versions
prior to Excel 2007 to use the EOMONTH function.
"dipsy" wrote in message
...
I know the month and want a formula that will tell me number of days in
the
month. For example, April would be 30 days and May would be 31 days.
|