Calculate Days in a Month
On Thu, 12 Jan 2006 22:30:02 -0800, LGG wrote:
Hi. I need help finding a formula to calculate the number of days in a month
depending on the month you choose from a drop down menu.
Example:
In cell A1 user will be ask to select a month from a drop down menu.
In cell B1 I want the number of days in the month corresponding to the month
selected in A1. So, if February is chosen on A1, then 28 (days) would appear
on B1.
I was trying to do if statements, but I keep getting an error. Is there an
easy way to do this?
Thanks
LGG
To check the days of the month, I assumed that
1. The month you are choosing is from a list of text strings, and not real
Excel dates formatted to show just the month.
2. The year is "this" year, so February will only show 29 days if "this" year
is a leap year.
B1:
=DAY((A1&YEAR(TODAY()))+32-DAY((A1&YEAR(TODAY()))+32))
--ron
|