Series of months/year and # days for those months

Ludovico

Board Regular
Joined
Apr 3, 2002
Messages
71
B6 contains Today() function
A15 should return the month, year of the following month based on today’s date (ie today is August 26, 2002 so A15 would read: “September, 2002”
A16 to return the following month, year (eg “October, 2002) and so on through A134
B15:B134 should return the number of days for the corresponding months in column A, eg B16 would read "31". Needs to recognize leap years (2004, 2008, 2012, 2016, 2020, 2024) and assign 29 days to February in those years.
I tried =DATE(YEAR($B$6),MONTH(EDATE($B$6,k15)),1) in A15 and copied down (column K corresponded to month 1, month 2, and so on), but the results all were 2002 and I wouldn’t have a clue as how to use that approach to get the number of days/month in column B anyway.

Any help will be appreciated.
Ludovico
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
On 2002-08-28 07:11, Ludovico wrote:
B6 contains Today() function
A15 should return the month, year of the following month based on today’s date (ie today is August 26, 2002 so A15 would read: “September, 2002”
A16 to return the following month, year (eg “October, 2002) and so on through A134
B15:B134 should return the number of days for the corresponding months in column A, eg B16 would read "31". Needs to recognize leap years (2004, 2008, 2012, 2016, 2020, 2024) and assign 29 days to February in those years.
I tried =DATE(YEAR($B$6),MONTH(EDATE($B$6,k15)),1) in A15 and copied down (column K corresponded to month 1, month 2, and so on), but the results all were 2002 and I wouldn’t have a clue as how to use that approach to get the number of days/month in column B anyway.

Any help will be appreciated.
Ludovico

In A15 enter & copy down:

=DATE(YEAR($B$6),MONTH($B$6)+ROW(1:1),1)

Alternatively:

=EDATE($B$6,ROW(1:1))-DAY($B$6)+1

In B15 enter & copy down:

=DAY(EOMONTH(A15,0))
 
Upvote 0
Aladin:
Perfect; thanks much.
Somehow I thought it would be you helping me on this one.
Hope things are well across the Atlantic.
Dwight
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

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