Create array based on cell reference

mbarbera83

New Member
Joined
Feb 17, 2015
Messages
27
Hi all.

I have a list of data that I need an array created

ABC
1X20194
2Y201310
3Z20158
4

I have Tried MakeArray with Lambda, but i cant seem to get it right I need the array to populate the following, 1 column with multiple rows, number of rows determined by column C, and the value of each row to be the starting point in Column B, + 1 year for each row
Start with the year in B1, and then add 1 year on for each row - number of rows determined by column C - in this case 4 rows of X



B1
B1 + 1
B1 + 1 + 1
B1 + 1 + 1 + 1
B2
B2 + 1
B2 + 1 +1 - this to continue for 10 rows

I would really appreciate help in this regard.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
How about
Fluff.xlsm
ABCDE
1201942019
22013102020
3201582021
42022
52013
62014
72015
82016
92017
102018
112019
122020
132021
142022
152015
162016
172017
182018
192019
202020
212021
222022
Main
Cell Formulas
RangeFormula
E1:E22E1=LET(s,SCAN(0,C1:C3,LAMBDA(a,b,a+b)),x,SEQUENCE(MAX(s)),XLOOKUP(x,s,B1:B3,,1)+DROP(REDUCE(0,C1:C3,LAMBDA(x,y,VSTACK(x,SEQUENCE(y,,0)))),1))
Dynamic array formulas.
 
Upvote 0
This is amazing thanks.
If I had a name in A1:A3 example Name1, Name2, Name3,
How would you have this be populated in Column D next to the years?
 
Upvote 0
How about
Fluff.xlsm
ABCDEF
1A20194A2019
2B201310A2020
3C20158A2021
4A2022
5B2013
6B2014
7B2015
8B2016
9B2017
10B2018
11B2019
12B2020
13B2021
14B2022
15C2015
16C2016
17C2017
18C2018
19C2019
20C2020
21C2021
22C2022
Main
Cell Formulas
RangeFormula
E1:F22E1=LET(s,SCAN(0,C1:C3,LAMBDA(a,b,a+b)),x,SEQUENCE(MAX(s)),HSTACK(XLOOKUP(x,s,A1:A3,,1),XLOOKUP(x,s,B1:B3,,1)+DROP(REDUCE(0,C1:C3,LAMBDA(x,y,VSTACK(x,SEQUENCE(y,,0)))),1)))
Dynamic array formulas.
 
Upvote 0
Or to make it even easier - how do I make the array create the example below by repeating a row x many times, then moving onto the next row.

I can always do the year based on a formula

Name1
Name1
Name1
Name1
Name2
 
Upvote 0
Thank yo
How about
Fluff.xlsm
ABCDEF
1A20194A2019
2B201310A2020
3C20158A2021
4A2022
5B2013
6B2014
7B2015
8B2016
9B2017
10B2018
11B2019
12B2020
13B2021
14B2022
15C2015
16C2016
17C2017
18C2018
19C2019
20C2020
21C2021
22C2022
Main
Cell Formulas
RangeFormula
E1:F22E1=LET(s,SCAN(0,C1:C3,LAMBDA(a,b,a+b)),x,SEQUENCE(MAX(s)),HSTACK(XLOOKUP(x,s,A1:A3,,1),XLOOKUP(x,s,B1:B3,,1)+DROP(REDUCE(0,C1:C3,LAMBDA(x,y,VSTACK(x,SEQUENCE(y,,0)))),1)))
Dynamic array formulas.
Thank you. this is amazing! it worked for a small range of data, but i am getting a calc error for the bigger range, is there a reason why?
Block NameDate preppedage at current
U1
2018​
4​
U2
2000​
22​
U3
2017​
5​
U4
2008​
14​
U5
2009​
13​
U6
2028​
0​
U7
2011​
11​
U8
2014​
8​
U9
2020​
2​
U10
2016​
6​
U11
2009​
13​
U12
2013​
9​
U13
2014​
8​
U14
2030​
0​
U15
2015​
7​
U16
2008​
14​
U17
2015​
7​
U18
2013​
9​
U19
2005​
17​
U20
2004​
18​
U21
2028​
0​
U22
2014​
8​
U23
2018​
4​
U24
2004​
18​
U25
2004​
18​
U26
2012​
10​
U27
2013​
9​
U28
2018​
4​
U29
2018​
4​
U30
2016​
6​
U31
2008​
14​
U32
2005​
17​
U33
2005​
17​
U34
2014​
8​
U35
2010​
12​
U36
2004​
18​
U37
2016​
6​
U38
2006​
16​
U39
2006​
16​
U40
2015​
7​
U41
2016​
6​
U42
2014​
8​
U43
2009​
13​
U44
2011​
11​
U45
2015​
7​
U46
2015​
7​
U47
2005​
17​
U48
2008​
14​
U49
2019​
3​
U50
2005​
17​
 
Upvote 0
is there a reason why?
Yes you have 0 values in there try.
Excel Formula:
=LET(s,SCAN(0,C2:C51,LAMBDA(a,b,a+b)),x,SEQUENCE(MAX(s)),HSTACK(XLOOKUP(x,s,A2:A51,,1),XLOOKUP(x,s,B2:B51,,1)+DROP(REDUCE(0,C2:C51,LAMBDA(x,y,IF(y=0,0,VSTACK(x,SEQUENCE(y,,0))))),1)))
 
Upvote 0
Yes you have 0 values in there try.
Excel Formula:
=LET(s,SCAN(0,C2:C51,LAMBDA(a,b,a+b)),x,SEQUENCE(MAX(s)),HSTACK(XLOOKUP(x,s,A2:A51,,1),XLOOKUP(x,s,B2:B51,,1)+DROP(REDUCE(0,C2:C51,LAMBDA(x,y,IF(y=0,0,VSTACK(x,SEQUENCE(y,,0))))),1)))
You are a Legend!!!!!! Thank you thank you thank you!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,216,152
Messages
6,129,168
Members
449,490
Latest member
TheSliink

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