ARRAY1DTO2D Splits a 1D array into a 2D array of equal heights given a divisor (e.g. array of 30 rows and a divisor of 3 will return the 1D array to a 3x10 2D array).
Excel Formula:
=LAMBDA(array,divisor,LET(a,array,d,divisor,s,SEQUENCE(d,ROWS(a)/d),return,INDEX(a,s,1),return))
| Lambda - Last Cell and Split.xlsx | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| B | C | D | E | F | G | H | |||
| 1 | Original Array | Resized array | |||||||
| 2 | 1 | 1 | 2 | 3 | |||||
| 3 | 2 | 4 | 5 | 6 | |||||
| 4 | 3 | 7 | 8 | 9 | |||||
| 5 | 4 | 10 | 11 | 12 | |||||
| 6 | 5 | ||||||||
| 7 | 6 | ||||||||
| 8 | 7 | ||||||||
| 9 | 8 | ||||||||
| 10 | 9 | ||||||||
| 11 | 10 | ||||||||
| 12 | 11 | ||||||||
| 13 | 12 | ||||||||
Sheet1 | |||||||||
| Cell Formulas | ||
|---|---|---|
| Range | Formula | |
| B2:B13 | B2 | =SEQUENCE(12) |
| F2:H5 | F2 | =ARRAY1DTO2D(B2#,4) |
| Dynamic array formulas. | ||
Upvote
0