RIGHTARRAY returns the right n columns (or rows, or both) of an array
Excel Formula:
=LAMBDA(array,n,direction,
SWITCH(direction,
0,INDEX(array,SEQUENCE(ROWS(array)),SEQUENCE(1,n,COLUMNS(array)-n+1)),
1,INDEX(array,SEQUENCE(n,1,ROWS(array)-n+1),SEQUENCE(,COLUMNS(array))),
2,INDEX(array,SEQUENCE(n,1,ROWS(array)-n+1),SEQUENCE(1,n,COLUMNS(array)-n+1)),
INDEX(array,SEQUENCE(ROWS(array)),SEQUENCE(1,n,COLUMNS(array)-n+1))
)
)
| Lambda - Last Cell and Split.xlsx | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| B | C | D | E | F | G | H | I | J | K | L | M | N | O | |||
| 1 | Original Array | Left 2 Columns | Left 2 Rows | Left 2 columns and rows | ||||||||||||
| 2 | this | is | my | is | my | or | numbers | like | numbers | like | ||||||
| 3 | array | of | words | of | words | 1 | 2 | 3 | 2 | 3 | ||||||
| 4 | or | numbers | like | numbers | like | |||||||||||
| 5 | 1 | 2 | 3 | 2 | 3 | |||||||||||
| 6 | ||||||||||||||||
Sheet1 | ||||||||||||||||
| Cell Formulas | ||
|---|---|---|
| Range | Formula | |
| F2:G5 | F2 | =RIGHTARRAY($B$2:$D$5,2,) |
| I2:K3 | I2 | =RIGHTARRAY($B$2:$D$5,2,1) |
| M2:N3 | M2 | =RIGHTARRAY($B$2:$D$5,2,2) |
| Dynamic array formulas. | ||
Upvote
0