Xlambda
Well-known Member
- Joined
- Mar 8, 2021
- Messages
- 860
- Office Version
- 365
- Platform
- Windows
AREMOVE !! recursive !! array remove, removes certain chars and replace them with a delimiter or not.
Other functions used on minisheet ASPLIT , AUNIQUE , AXLOOKUP , AREPLACE , ATEXTJOIN
Other functions used on minisheet ASPLIT , AUNIQUE , AXLOOKUP , AREPLACE , ATEXTJOIN
Excel Formula:
=LAMBDA(a,rm,d,
LET(n,LEN(rm),r,RIGHT(rm,1),
IF(n=0,ATRIM(a,d,),AREMOVE(SUBSTITUTE(a,r,d),LEFT(rm,n-1),d))
)
)
LAMBDA 7.0.xlsx | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | |||
1 | sample | extract unique codes | =AUNIQUE(E3#,0) | |||||||||||||
2 | 45SDF-dfg, 28KLM-tyubv, 28HJK-tgfhqw | =AREMOVE(A2:A4,T_CHARS(,-1,"-,"),"|") | =ASPLIT(C3#,"|") | 45SDF | ||||||||||||
3 | 523FOYP-gdjhsw, 28KLM-resdrftg | 45SDF| 28KLM| 28HJK | 45SDF | 28KLM | 28HJK | 28KLM | ||||||||||
4 | 28HJK-nvdww, 523WQSD-rxjjytrd | 523FOYP| 28KLM | 523FOYP | 28KLM | 28HJK | |||||||||||
5 | 28HJK| 523WQSD | 28HJK | 523WQSD | 523FOYP | ||||||||||||
6 | extract unique nrs. | 523WQSD | codes | |||||||||||||
7 | refine chars in T_CHARS selection | =AREMOVE(A2:A4,T_CHARS(,2,",-"),",") | =ASPLIT(C8#,",") | =AUNIQUE(E8#,) | 28 | 29 | 30 | |||||||||
8 | =T_CHARS(1,1,) | 45, 28, 28 | 45 | 28 | 28 | 45 | 43 | 44 | 45 | |||||||
9 | 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ | 523, 28 | 523 | 28 | 28 | 522 | 523 | 524 | ||||||||
10 | 28, 523 | 28 | 523 | 523 | cities | |||||||||||
11 | =AREMOVE(T_CHARS(1,1,),"01234QWERTY",) | Hague | London | Madrid | ||||||||||||
12 | 56789ABCDFGHIJKLMNOPSUVXZ | count how many unique colors | =AXLOOKUP(I8#,K7:M9,K11:M13,,,) | NY | LA | Boston | ||||||||||
13 | remove chars above | FG234ed red, HG723lu blue | Boston | Seoul | Tokyo | Beijing | ||||||||||
14 | 46890GJKQKJT,98765432YTRELKJHG | SD94yd cyan, LMNre red | Hague | |||||||||||||
15 | FGKERT38502, 2982136BVCXWYTQ | YW39en green yellow blue | Tokyo | |||||||||||||
16 | replace | with | ||||||||||||||
17 | =AREMOVE(A14:A15,A12,"") | remove digits | red | 1 | ||||||||||||
18 | 40QT,432YTRE | =AREMOVE(C13:C15,T_CHARS(1,,),"") | magenta | 2 | ||||||||||||
19 | ERT302, 2213WYTQ | FGed red, HGlu blue | blue | 3 | ||||||||||||
20 | SDyd cyan, LMNre red | brown | 4 | |||||||||||||
21 | other lambdas used in the minisheet | YWen green yellow blue | green | 5 | ||||||||||||
22 | ASPLIT | yellow | 6 | |||||||||||||
23 | AUNIQUE | replace colors with nrs | cyan | 7 | ||||||||||||
24 | AXLOOKUP | =AREPLACE(C19#,E17:E23,F17:F23) | ||||||||||||||
25 | AREPLACE | FGed 1, HGlu 3 | ||||||||||||||
26 | ATEXTJOIN | SDyd 7, LMNre 1 | ||||||||||||||
27 | YWen 5 6 3 | |||||||||||||||
28 | ddhh65✌hfg456?u7462? | |||||||||||||||
29 | =AREMOVE(A28,T_CHARS(1,-1,),"-") | extract nrs | ||||||||||||||
30 | ✌-?-? | =AREMOVE(LOWER(C25#),T_CHARS(,-1,","),"") | =ASPLIT(C31#," ") | =COUNT(--AUNIQUE(F31#,)) | ||||||||||||
31 | 1 3 | 1 | 3 | 5 | ||||||||||||
32 | 7 1 | 7 | 1 | |||||||||||||
33 | 5 6 3 | 5 | 6 | 3 | ||||||||||||
34 | ||||||||||||||||
35 | extract unique capital letter codes | |||||||||||||||
36 | TWE678-hgd,GHY2897-ersy | WQ YGD hj-53 | ||||||||||||||
37 | VBF32-hthg | gfhRTY764,435KHtyr | ||||||||||||||
38 | JHG876-wqer,YGD jhgj-567 | WQ | =ASPLIT(B46#," ") | =SORT(AUNIQUE(D39#,)) | ||||||||||||
39 | TWE | GHY | WQ | YGD | GHY | |||||||||||
40 | =ATEXTJOIN(A36:B38,,,"|") | VBF | RTY | KH | JHG | |||||||||||
41 | TWE678-hgd,GHY2897-ersy|WQ YGD hj-53 | JHG | YGD | WQ | KH | |||||||||||
42 | VBF32-hthg|gfhRTY764,435KHtyr | RTY | ||||||||||||||
43 | JHG876-wqer,YGD jhgj-567|WQ | TWE | ||||||||||||||
44 | VBF | |||||||||||||||
45 | =AREMOVE(A41#,T_CHARS(1,-1,"-,|"),",") | =AREPLACE(A46#,","," ") | WQ | |||||||||||||
46 | TWE,GHY,WQ YGD | TWE GHY WQ YGD | YGD | |||||||||||||
47 | VBF,RTY,KH | VBF RTY KH | ||||||||||||||
48 | JHG,YGD ,WQ | JHG YGD WQ | ||||||||||||||
49 | ||||||||||||||||
AREMOVE post |
Cell Formulas | ||
---|---|---|
Range | Formula | |
I1,A45:B45,A40,I38,D38,J30,C30,F30,A29,C24,C18,A17,A11,A8,I7,C7,E7,C2,E2 | I1 | =FORMULATEXT(I2) |
I2:I6 | I2 | =AUNIQUE(E3#,0) |
C3:C5 | C3 | =AREMOVE(A2:A4,T_CHARS(,-1,"-,"),"|") |
E3:G5 | E3 | =ASPLIT(C3#,"|") |
C8:C10 | C8 | =AREMOVE(A2:A4,T_CHARS(,2,",-"),",") |
E8:G10 | E8 | =ASPLIT(C8#,",") |
I8:I10 | I8 | =AUNIQUE(E8#,) |
A9 | A9 | =T_CHARS(1,1,) |
A12 | A12 | =AREMOVE(T_CHARS(1,1,),"01234QWERTY",) |
H12 | H12 | =FORMULATEXT(I13) |
I13:I15 | I13 | =AXLOOKUP(I8#,K7:M9,K11:M13,,,) |
A18:A19 | A18 | =AREMOVE(A14:A15,A12,"") |
C19:C21 | C19 | =AREMOVE(C13:C15,T_CHARS(1,,),"") |
C25:C27 | C25 | =AREPLACE(C19#,E17:E23,F17:F23) |
A30 | A30 | =AREMOVE(A28,T_CHARS(1,-1,),"-") |
C31:C33 | C31 | =AREMOVE(LOWER(C25#),T_CHARS(,-1,","),"") |
F31:H33 | F31 | =ASPLIT(C31#," ") |
J31 | J31 | =COUNT(--AUNIQUE(F31#,)) |
D39:G41 | D39 | =ASPLIT(B46#," ") |
I39:I46 | I39 | =SORT(AUNIQUE(D39#,)) |
A41:A43 | A41 | =ATEXTJOIN(A36:B38,,,"|") |
A46:A48 | A46 | =AREMOVE(A41#,T_CHARS(1,-1,"-,|"),",") |
B46:B48 | B46 | =AREPLACE(A46#,","," ") |
Dynamic array formulas. |
Upvote
0