Auto fill in period of date based on the date in a certain cell

Goddess

Board Regular
Joined
Dec 3, 2015
Messages
94
Office Version
  1. 2019
Platform
  1. Windows
Hi,

I'm trying to get my spreadsheet to auto fill up the yellow cells, based on the info in the green cell. Example as below:

1632638577141.png


Cell A6 is the first 3 months period from cell B1. For example, if B1 is 1 Feb 21, then A6 will be "Feb - Apr 21". Cells B6:D6 are subsequent 3 months period from the corresponding cells on the left. Is there anyway to do it?

Thanks!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
How About:
Book1
ABCDE
1From6/1/2021
2To5/31/2021
3
4
5Session 1Session 2Session 3Session 4
6Jun - Aug 21Sep - Nov 21Dec - Feb 22Mar - May 22
7
8
9
Sheet3
Cell Formulas
RangeFormula
A6:D6A6=CONCAT(TEXT(EOMONTH($B$1,(COLUMNS($A$6:A6)-1)*3),"MMM"), " - ", TEXT(EOMONTH($B$1,COLUMNS($A$6:A6)*3-2) + 1,"MMM"), " ",TEXT(EOMONTH($B$1,COLUMNS($A$6:A6)*3-2) + 1,"YY"))
 
Upvote 0
Solution
Or this:
Book1
ABCDEFG
1From6/1/2021
2To6/30/2022
3
4
5Session 1Session 2Session 3Session 4Session 5Session 6
6Jun - Aug 21Sep - Nov 21Dec - Feb 22Mar - May 22Jun - Jun 22 
7
8
9
Sheet3
Cell Formulas
RangeFormula
A6:F6A6=IF(INT(((YEAR($B$2)-YEAR($B$1))*12 + MONTH($B$2)-MONTH($B$1) + 1)/3)>=COLUMNS($A$6:A6),CONCAT(TEXT(EOMONTH($B$1,(COLUMNS($A$6:A6)-1)*3),"MMM"), " - ", TEXT(EOMONTH($B$1,COLUMNS($A$6:A6)*3-2) + 1,"MMM"), " ",TEXT(EOMONTH($B$1,COLUMNS($A$6:A6)*3-2) + 1,"YY")),IF((((YEAR($B$2)-YEAR($B$1))*12 + MONTH($B$2)-MONTH($B$1) + 4)) >COLUMNS($A$6:A6) * 3,CONCAT(TEXT(EOMONTH($B$1,(COLUMNS($A$6:A6)-1)*3),"MMM"), " - ", TEXT(EOMONTH($B$2,0),"MMM"), " ",TEXT(EOMONTH($B$2,0),"YY")),""))
 
Upvote 0
=IF(INT(((YEAR($B$2)-YEAR($B$1))*12 + MONTH($B$2)-MONTH($B$1) + 1)/3)>=COLUMNS($A$6:A6),CONCAT(TEXT(EOMONTH($B$1,(COLUMNS($A$6:A6)-1)*3),"MMM"), " - ", TEXT(EOMONTH($B$1,COLUMNS($A$6:A6)*3-2) + 1,"MMM"), " ",TEXT(EOMONTH($B$1,COLUMNS($A$6:A6)*3-2) + 1,"YY")),IF((((YEAR($B$2)-YEAR($B$1))*12 + MONTH($B$2)-MONTH($B$1) + 4)) >COLUMNS($A$6:A6) * 3,CONCAT(TEXT(EOMONTH($B$1,(COLUMNS($A$6:A6)-1)*3),"MMM"), " - ", TEXT(EOMONTH($B$2,0),"MMM"), " ",TEXT(EOMONTH($B$2,0),"YY")),""))
Hi Maabadi,

Thanks so much!
 
Upvote 0
This is a fair bit shorter & I think still does what you want?

21 09 26.xlsm
ABCDE
11-Jan-21
231-Dec-21
3
4
5
6Jan - Mar 21Apr - Jun 21Jul - Sep 21Oct - Dec 21 
Date Ranges
Cell Formulas
RangeFormula
A6:E6A6=IF(EDATE($B1,COLUMNS($A:A)*3-3)>$B2,"",TEXT(EDATE($B1,COLUMNS($A:A)*3-3),"mmm")&TEXT(MIN(EDATE($B1,COLUMNS($A:A)*3-1),$B2)," - mmm yy"))
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,215,045
Messages
6,122,840
Members
449,096
Latest member
Erald

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