# Formula For Number Of Days In A Month

• Hi all,

I have checked searching the forums for this but nothing that really matches what I am looking for. I am trying to, from a date, deduce how many days there are in that month. I have tried a solution where I look at EOMONTH adding and subtracting but this is quite cumbersome. Is there some code out there where someone has solved this?

/Robert

.¸¸·´¯'·.¸¸.·´¯'·.¸¸·´¯'·.¸¸.·´¯'·.¸¸·´¯'·.¸¸.· ><((((º>

• Re: Formula For Number Of Days In A Month

Hi Robert

Something like this will work:

=DAY(DATE(YEAR(A1),MONTH(A1)+1,0))

Richard

• Re: Formula For Number Of Days In A Month

Cool thank you very much!!

;o)

Robert

.¸¸·´¯'·.¸¸.·´¯'·.¸¸·´¯'·.¸¸.·´¯'·.¸¸·´¯'·.¸¸.· ><((((º>

• Re: Formula For Number Of Days In A Month

That IS cool! Never saw that remark on the Help for the DATE function before.

• Re: Formula For Number Of Days In A Month

even cooler...bravo!

• Re: Formula For Number Of Days In A Month

Here's another way

=42-DAY(A1-DAY(A1)+42)

42 can actually be replaced with any number between 32 and 59.....as long as you use the same number twice

• Re: Formula For Number Of Days In A Month

Here's another way

=42-DAY(A1-DAY(A1)+42)

42 can actually be replaced with any number between 32 and 57.....as long as you use the same number twice

Smartass

• Re: Formula For Number Of Days In A Month

Quote from RichardSchollar

Smartass

Hello Rich, I'm torn between "It takes one to know one" and "It's better to be a Smartass than a Dumbass!" :duck:

• Re: Formula For Number Of Days In A Month

Quote

"It's better to be a Smartass than a Dumbass!"

I'd rather just be an "ass" or arse

## Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!