Number of days in a month

Don C

Board Regular
Joined
Feb 24, 2002
Messages
72
The function WEEKDAY will tell me the day of the week that a date falls on.

How can I determine the number of days in the month of that date?

In cell A2, I enter a date, say 1/1/2003 and I want to know the number of days in January.

(I know, I can look on a calendar, but I'd like some sort of automation. Next year is a Leap Year and I'd like the calendar I am building to know that.)

Thanks
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Dear

insert table as following :

Column B (B1) Month, (B2) Jan-2015 , (B3) Feb-2015 , (B4) Mar-2015 ..... till Dec-2015
Column C (C1) Month No., (C2) =MONTH(B2), (C3)=MONTH(B3), (C4)=MONTH(B4)....till =MONTH(B13)
Column D (D1)Days, (C2) =DAY(EOMONTH(B2,0)), (C3)=DAY(EOMONTH(B3,0)), (C4)=DAY(EOMONTH(B2,0))....till =DAY(EOMONTH(B13,0))

then follow the following Equation assumed that date is 24 Aug 2015 in Cell G2 :

=VLOOKUP((MONTH(G2)),$C$1:$D$13,2,0)
 
Upvote 0
The function WEEKDAY will tell me the day of the week that a date falls on.

How can I determine the number of days in the month of that date?

In cell A2, I enter a date, say 1/1/2003 and I want to know the number of days in January.

(I know, I can look on a calendar, but I'd like some sort of automation. Next year is a Leap Year and I'd like the calendar I am building to know that.)

Thanks

Hi,

Try the following formula

=DAY(DATE(YEAR(A1),MONTH(A1)+1,1)-1)
 
Upvote 0
I know this is an old thread. But still, here is something very short and simple:

=day(eomonth(A1,0))
 
Upvote 0

Forum statistics

Threads
1,215,156
Messages
6,123,339
Members
449,098
Latest member
thnirmitha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top