RICH937
Board Regular
- Joined
- Apr 15, 2023
- Messages
- 59
- Office Version
- 365
- Platform
- Windows
- Mobile
I am using a let formula I found here (I believe) to add blank lines in a dynamic array. It's my first attempt to use the newer "Let" functionality, and while the formula here works, I cannot seem to get it to function without using hstack and a separate formula for each columns. I tried changing the number of columns in the "makearray" portion, and while it returns the 5 columns, all columns are filled with "REF" errors. Anyone know how to alter this formula so all the commands are in one LET(array,CHOOSECOLS($A3#,1),spacer,2,MAKEARRAY(ROWS(array)*spacer-(spacer-1),1,LAMBDA(r,c,IF(MOD(r-1,spacer),"",INDEX(array,ROUND((r-1)/spacer,0)+1))))) function, and no hstack is necessary?
NOTE: I went this way instead of the textjoin/textsplit route as the source data way exceeds the character limit.
thanks in advance you epic people!
NOTE: I went this way instead of the textjoin/textsplit route as the source data way exceeds the character limit.
thanks in advance you epic people!
Excel please help example3.xlsx | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | |||
1 | ARRAY | SPACED ARRAY | ||||||||||||
2 | CATEGORY | CUSTOMER NAME | PRODUCT SELECTED | DISTRIBUTOR | VOLUME | CATEGORY | CUSTOMER NAME | PRODUCT SELECTED | DISTRIBUTOR | VOLUME | ||||
3 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 1 | DISTRIBUTOR 1 | 1825 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 1 | DISTRIBUTOR 1 | 1825 | ||||
4 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 2 | DISTRIBUTOR 2 | 3710 | |||||||||
5 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 2 | DISTRIBUTOR 2 | 2900 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 2 | DISTRIBUTOR 2 | 3710 | ||||
6 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 840 | |||||||||
7 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 1 | DISTRIBUTOR 1 | 760 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 2 | DISTRIBUTOR 2 | 2900 | ||||
8 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 1 | DISTRIBUTOR 1 | 580 | |||||||||
9 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 3 | DISTRIBUTOR 2 | 350 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 840 | ||||
10 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 1490 | |||||||||
11 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 3 | DISTRIBUTOR 2 | 1290 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 1 | DISTRIBUTOR 1 | 760 | ||||
12 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 920 | |||||||||
13 | CHANNEL 2 | CUSTOMER 1 | PRODUCT 2 | DISTRIBUTOR 2 | 2370 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 1 | DISTRIBUTOR 1 | 580 | ||||
14 | CHANNEL 2 | CUSTOMER 1 | PRODUCT 2 | DISTRIBUTOR 2 | 1570 | |||||||||
15 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 4775 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 3 | DISTRIBUTOR 2 | 350 | ||||
16 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 2 | DISTRIBUTOR 2 | 4160 | |||||||||
17 | CHANNEL 2 | CUSTOMER 1 | PRODUCT 3 | DISTRIBUTOR 1 | 2720 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 1490 | ||||
18 | CHANNEL 2 | CUSTOMER 1 | PRODUCT 2 | DISTRIBUTOR 2 | 2700 | |||||||||
19 | CHANNEL 2 | CUSTOMER 1 | PRODUCT 1 | DISTRIBUTOR 1 | 690 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 3 | DISTRIBUTOR 2 | 1290 | ||||
20 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 3 | DISTRIBUTOR 2 | 630 | |||||||||
21 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 2 | DISTRIBUTOR 2 | 510 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 920 | ||||
22 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 2 | DISTRIBUTOR 2 | 330 | |||||||||
23 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 320 | CHANNEL 2 | CUSTOMER 1 | PRODUCT 2 | DISTRIBUTOR 2 | 2370 | ||||
24 | ||||||||||||||
25 | DATA SET | CHANNEL 2 | CUSTOMER 1 | PRODUCT 2 | DISTRIBUTOR 2 | 1570 | ||||||||
26 | CATEGORY | CUSTOMER NAME | PRODUCT SELECTED | DISTRIBUTOR | VOLUME | |||||||||
27 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 1 | DISTRIBUTOR 1 | 1825 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 4775 | ||||
28 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 2 | DISTRIBUTOR 2 | 3710 | |||||||||
29 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 2 | DISTRIBUTOR 2 | 2900 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 2 | DISTRIBUTOR 2 | 4160 | ||||
30 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 840 | |||||||||
31 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 1 | DISTRIBUTOR 1 | 760 | CHANNEL 2 | CUSTOMER 1 | PRODUCT 3 | DISTRIBUTOR 1 | 2720 | ||||
32 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 1 | DISTRIBUTOR 1 | 580 | |||||||||
33 | CHANNEL 1 | CUSTOMER 1 | PRODUCT 3 | DISTRIBUTOR 2 | 350 | CHANNEL 2 | CUSTOMER 1 | PRODUCT 2 | DISTRIBUTOR 2 | 2700 | ||||
34 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 1490 | |||||||||
35 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 3 | DISTRIBUTOR 2 | 1290 | CHANNEL 2 | CUSTOMER 1 | PRODUCT 1 | DISTRIBUTOR 1 | 690 | ||||
36 | CHANNEL 1 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 920 | |||||||||
37 | CHANNEL 2 | CUSTOMER 1 | PRODUCT 2 | DISTRIBUTOR 2 | 2370 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 3 | DISTRIBUTOR 2 | 630 | ||||
38 | CHANNEL 2 | CUSTOMER 1 | PRODUCT 2 | DISTRIBUTOR 2 | 1570 | |||||||||
39 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 4775 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 2 | DISTRIBUTOR 2 | 510 | ||||
40 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 2 | DISTRIBUTOR 2 | 4160 | |||||||||
41 | CHANNEL 2 | CUSTOMER 1 | PRODUCT 3 | DISTRIBUTOR 1 | 2720 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 2 | DISTRIBUTOR 2 | 330 | ||||
42 | CHANNEL 2 | CUSTOMER 1 | PRODUCT 2 | DISTRIBUTOR 2 | 2700 | |||||||||
43 | CHANNEL 2 | CUSTOMER 1 | PRODUCT 1 | DISTRIBUTOR 1 | 690 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 320 | ||||
44 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 3 | DISTRIBUTOR 2 | 630 | |||||||||
45 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 2 | DISTRIBUTOR 2 | 510 | |||||||||
46 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 2 | DISTRIBUTOR 2 | 330 | |||||||||
47 | CHANNEL 2 | CUSTOMER 2 | PRODUCT 1 | DISTRIBUTOR 1 | 320 | |||||||||
48 | ||||||||||||||
Sheet2 (2) |
Cell Formulas | ||
---|---|---|
Range | Formula | |
A3:E23 | A3 | =DataSet |
G3:K43 | G3 | =HSTACK(LET(array,CHOOSECOLS($A3#,1),spacer,2,MAKEARRAY(ROWS(array)*spacer-(spacer-1),1,LAMBDA(r,c,IF(MOD(r-1,spacer),"",INDEX(array,ROUND((r-1)/spacer,0)+1))))),LET(array,CHOOSECOLS($A3#,2),spacer,2,MAKEARRAY(ROWS(array)*spacer-(spacer-1),1,LAMBDA(r,c,IF(MOD(r-1,spacer),"",INDEX(array,ROUND((r-1)/spacer,0)+1))))),LET(array,CHOOSECOLS($A3#,3),spacer,2,MAKEARRAY(ROWS(array)*spacer-(spacer-1),1,LAMBDA(r,c,IF(MOD(r-1,spacer),"",INDEX(array,ROUND((r-1)/spacer,0)+1))))),LET(array,CHOOSECOLS($A3#,4),spacer,2,MAKEARRAY(ROWS(array)*spacer-(spacer-1),1,LAMBDA(r,c,IF(MOD(r-1,spacer),"",INDEX(array,ROUND((r-1)/spacer,0)+1))))),LET(array,CHOOSECOLS($A3#,5),spacer,2,MAKEARRAY(ROWS(array)*spacer-(spacer-1),1,LAMBDA(r,c,IF(MOD(r-1,spacer),"",INDEX(array,ROUND((r-1)/spacer,0)+1)))))) |
Dynamic array formulas. |