Autofil Months based on date range in other cells.

mistatasty

New Member
Joined
Jul 21, 2021
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a start and end date for a performance period in cell b5 and b6, respectively. Below that, I would like in row 25 all of the months in that period to auto populate. So if 1/1/20 was entered in cell b5 as the start date and 1/1/21 was entered in cell b6 as the end date, row 25 starting in column e would auto fill the months jan 20, feb 20, mar 20.... all the way to jan 21. Ideally when you expand or contract the end starting or end dates in b5 and b6, row 25 would also add or contract the dates. Any way to do this? Thanks
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
If you want a formula you can do this:

=IF(EDATE($B$5,COLUMNS($A$1:A1)-1)<=$C$5,TEXT(EDATE($B$5,COLUMNS($A$1:A1)-1),"mmm yy"),"")

and copy across as far as you are ever likely to need.
 
Upvote 0
how many months is the maximum you foresee having? If the list is short, say a couple of years, you can use a pretty simple formula.

In E25: =EOMONTH(B5,0)
In F35 - XYZ25: =IF(E25>$C$5,"",EOMONTH(E25,1))

Then, format the field to dislay months and years as desired.
 
Upvote 0
how many months is the maximum you foresee having? If the list is short, say a couple of years, you can use a pretty simple formula.

In E25: =EOMONTH(B5,0)
In F35 - XYZ25: =IF(E25>$C$5,"",EOMONTH(E25,1))

Then, format the field to dislay months and years as desired.
the maximum would be 36 months.
 
Upvote 0
If you want a formula you can do this:

=IF(EDATE($B$5,COLUMNS($A$1:A1)-1)<=$C$5,TEXT(EDATE($B$5,COLUMNS($A$1:A1)-1),"mmm yy"),"")

and copy across as far as you are ever likely to need.
to clarify, start date is entered in cell b5. end date entered in b6. I need months to populate starting in cell e25 and continue until end date. How does that change the specifications of that formula? Thanks
 
Upvote 0
Ok i should read:

=IF(EDATE($B$5,COLUMNS($A$1:A1)-1)<=$B$6,TEXT(EDATE($B$5,COLUMNS($A$1:A1)-1),"mmm yy"),"")
 
Upvote 0
Solution

Forum statistics

Threads
1,214,523
Messages
6,120,042
Members
448,940
Latest member
mdusw

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