# of Days in Month

L

Laurie Forbes

Hello all:

I have a problem I hope someone can help with. Is there any way or
function to return the number of days in a given month (the specific
month given by the contents of a date formated cell)??

TIA for any assistance.........


Laurie Forbes
 
J

J.E. McGimpsey

One way:

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

(for XL, the zeroth day of the month is the last day of the previous
month)
 
R

Ron Rosenfeld

Hello all:

I have a problem I hope someone can help with. Is there any way or
function to return the number of days in a given month (the specific
month given by the contents of a date formated cell)??

TIA for any assistance.........


Laurie Forbes


=32-DAY(A1-DAY(A1)+32)

Courtesy of Daniel.M


--ron
 
T

Tim Benoit

Laurie Forbes wrote
....Is there any way or function to return the number of days in a
given month (the specific month given by the contents of a date
formated cell)??

If your date is in cell A1 then try this formula:
=IF(MONTH(A1)=12,("01/01/"&(YEAR(A1)+1))-(MONTH(A1)&"/01/"&YEAR(A1)),((MONTH(A1)+1)&"/01/"&YEAR(A1))-(MONTH(A1)&"/01/"&YEAR(A1)))

You can cut and paste the formula from this posting. It gives you a
number - for example, if cell A1 contains 12/3/2003 then the formula
returns 31.
 
L

Laurie Forbes

=32-DAY(A1-DAY(A1)+32)

Courtesy of Daniel.M

Thanks Ron - that's the best (shortest and handles leap years) so far
(even if I can't figure out how it works :)).


Laurie Forbes
 
L

Laurie Forbes

On 2 Dec 2003 11:02:14 -0800, (e-mail address removed) (2rrs) wrote:

This is the best yet IMO - it takes the place of honour in my
spreadsheet :)>). Thanks much.
with your date in A1
=DAY(EOMONTH(A1,0))


Laurie Forbes
 
P

Peo Sjoblom

FYI, it needs the ATP add-in, if you send a worksheet to someone who has not
installed ATP they'll get
a name error
 
L

Laurie Forbes

FYI, it needs the ATP add-in, if you send a worksheet to someone who has not
installed ATP they'll get
a name error

--

Regards,

Peo Sjoblom

Yes - I discovered that when I first tried it. It won't be a problem
however as the worksheet will not be sent to others.

Laurie Forbes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top