Xlambda
Well-known Member
- Joined
- Mar 8, 2021
- Messages
- 837
- Office Version
- 365
- Platform
- Windows
APP2V APPends 2 arrays Vertically, 2nd array row index and offset functionality. !! NEW !! MAKEARRAY
Excel Formula:
=LAMBDA(a1r,a2r,[i],[o],
LET(a,IF(a1r="","",a1r),b,IF(a2r="","",a2r),e,ROWS(a),f,ROWS(b),c,COLUMNS(a),d,COLUMNS(b),j,IF(OR(ISOMITTED(i),i=0),1,MEDIAN(i,-f,f)),
IFERROR(MAKEARRAY(e+IF(j<0,-j,f-j+1),MAX(IF(o<0,c-o,c),IF(o>0,d+o,d)),
LAMBDA(r,c,LET(y,IF(o>=0,IF(r>e,IF(c>o,c-o,""),c),IF(r<=e,IF(c>-o,c+o,""),c)),x,IF(r>e,IF(j>0,r-e+j-1,r-e),r),IF(r<=e,INDEX(a,x,y),INDEX(b,x,y))))),"")
)
)
| LAMBDA 1.1.1.xlsx | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | |||
| 1 | "i" row index argument (for 2nd array, "a2r" (b in our examples)) | |||||||||||||||||||||||||||
| 2 | i omitted or 0 or 1, appends whole b to a | |||||||||||||||||||||||||||
| 3 | i>0, appends only row indexes >=i of b (from i to the bottom, including i) | |||||||||||||||||||||||||||
| 4 | i<0, appends only rows indexes <=abs(i) of b (from abs(i) to the top, including i) | |||||||||||||||||||||||||||
| 5 | if abs(i)>rows(b) and i<0 i= -rows(b),so whole b is appended (from rows(b) to the top) | |||||||||||||||||||||||||||
| 6 | if abs(i)>rows(b) and i>0 i=rows(b),so only last row of b is appended (from rows(b) down) | |||||||||||||||||||||||||||
| 7 | "o" offset argument | |||||||||||||||||||||||||||
| 8 | o=0 arrays will be left aligned | if arrays arguments omitted | ||||||||||||||||||||||||||
| 9 | o>0 array b will offset "o" clms to the right | i,o,omitted | ||||||||||||||||||||||||||
| 10 | o<0 array b will offset "o" clms to the left | b | =APP2V(,I11:L14) | |||||||||||||||||||||||||
| 11 | 1 | 2 | 3 | 4 | ||||||||||||||||||||||||
| 12 | a | 2 | 4 | 5 | 1 | 2 | 3 | 4 | ||||||||||||||||||||
| 13 | a | b | c | d | e | f | 3 | 4 | 6 | 2 | 4 | 5 | ||||||||||||||||
| 14 | g | h | i | j | k | 4 | 5 | 6 | 4 | 3 | 4 | 6 | ||||||||||||||||
| 15 | 4 | 5 | 6 | 4 | ||||||||||||||||||||||||
| 16 | i,o,omitted | omitted array becomes a "" null string | ||||||||||||||||||||||||||
| 17 | b | =APP2V(B13:G14,C18:F21) | ||||||||||||||||||||||||||
| 18 | 1 | 2 | 3 | 4 | a | b | c | d | e | f | i,3,o,1 | |||||||||||||||||
| 19 | 2 | 4 | 5 | g | h | i | j | k | =APP2V(,I11:L14,3,1) | |||||||||||||||||||
| 20 | 3 | 4 | 6 | 1 | 2 | 3 | 4 | |||||||||||||||||||||
| 21 | 4 | 5 | 6 | 4 | 2 | 4 | 5 | 3 | 4 | 6 | ||||||||||||||||||
| 22 | 3 | 4 | 6 | 4 | 5 | 6 | 4 | |||||||||||||||||||||
| 23 | 4 | 5 | 6 | 4 | ||||||||||||||||||||||||
| 24 | if constant arrays | |||||||||||||||||||||||||||
| 25 | i,3,o,1 | i,-3,o,-1 | ||||||||||||||||||||||||||
| 26 | b | =APP2V(B13:G14,C27:F30,3,1) | =APP2V({2,2},I11:L14,-3,-1) | |||||||||||||||||||||||||
| 27 | 1 | 2 | 3 | 4 | a | b | c | d | e | f | 2 | 2 | ||||||||||||||||
| 28 | 2 | 4 | 5 | i,3 | g | h | i | j | k | 1 | 2 | 3 | 4 | |||||||||||||||
| 29 | ↓↓ | 3 | 4 | 6 | ↓↓ | 3 | 4 | 6 | 2 | 4 | 5 | |||||||||||||||||
| 30 | 4 | 5 | 6 | 4 | 4 | 5 | 6 | 4 | 3 | 4 | 6 | |||||||||||||||||
| 31 | ||||||||||||||||||||||||||||
| 32 | i,-3,o,2 | i,,o,-1 | ||||||||||||||||||||||||||
| 33 | b | =APP2V(B13:G14,C34:F37,-3,2) | =APP2V(I11:L14,"T",,-1) | |||||||||||||||||||||||||
| 34 | 1 | 2 | 3 | 4 | a | b | c | d | e | f | 1 | 2 | 3 | 4 | ||||||||||||||
| 35 | 2 | 4 | 5 | g | h | i | j | k | 2 | 4 | 5 | |||||||||||||||||
| 36 | ↑↑ | 3 | 4 | 6 | ↑↑ | 1 | 2 | 3 | 4 | 3 | 4 | 6 | ||||||||||||||||
| 37 | 4 | 5 | 6 | 4 | i,-3 | 2 | 4 | 5 | 4 | 5 | 6 | 4 | ||||||||||||||||
| 38 | 3 | 4 | 6 | T | ||||||||||||||||||||||||
| 39 | i,,o,1 | |||||||||||||||||||||||||||
| 40 | i,-2,o,-2 | =APP2V("T",I11:L14,,1) | ||||||||||||||||||||||||||
| 41 | b | =APP2V(B13:G14,C42:F45,-2,-2) | T | |||||||||||||||||||||||||
| 42 | 1 | 2 | 3 | 4 | a | b | c | d | e | f | 1 | 2 | 3 | 4 | ||||||||||||||
| 43 | 2 | 4 | 5 | g | h | i | j | k | 2 | 4 | 5 | |||||||||||||||||
| 44 | 3 | 4 | 6 | 1 | 2 | 3 | 4 | 3 | 4 | 6 | ||||||||||||||||||
| 45 | 4 | 5 | 6 | 4 | 2 | 4 | 5 | 4 | 5 | 6 | 4 | |||||||||||||||||
| 46 | ||||||||||||||||||||||||||||
APP2V post | ||||||||||||||||||||||||||||
| Cell Formulas | ||
|---|---|---|
| Range | Formula | |
| S10,I41,S40,S33,I33,S26,I26,S19,I17 | S10 | =FORMULATEXT(S11) |
| S11:V15 | S11 | =APP2V(,I11:L14) |
| I18:N23 | I18 | =APP2V(B13:G14,C18:F21) |
| S20:W22 | S20 | =APP2V(,I11:L14,3,1) |
| I27:N30 | I27 | =APP2V(B13:G14,C27:F30,3,1) |
| S27:V30 | S27 | =APP2V({2,2},I11:L14,-3,-1) |
| I34:N38 | I34 | =APP2V(B13:G14,C34:F37,-3,2) |
| S34:W38 | S34 | =APP2V(I11:L14,"T",,-1) |
| S41:W45 | S41 | =APP2V("T",I11:L14,,1) |
| I42:P45 | I42 | =APP2V(B13:G14,C42:F45,-2,-2) |
| Dynamic array formulas. | ||
Upvote
0