Xlambda
Well-known Member
- Joined
- Mar 8, 2021
- Messages
- 860
- Office Version
- 365
- Platform
- Windows
AFILTER filters array by rows, text, non blanks or numbers, left aligned.
Excel Formula:
=LAMBDA(ar,k,nf,
LET(xk, OR(k={-1,0,1}),
r,ROWS(ar),
c,COLUMNS(ar),
sr,SEQUENCE(r),
s,SEQUENCE(r*c),
q,QUOTIENT(s-1,c)+1,
m,MOD(s-1,c)+1,
a,INDEX(IF(ar="","",ar),q,m),
x,a<>"",
f,SWITCH(k,-1,x*ISTEXT(a),0,--x,1,x*ISNUMBER(a)),
na,FILTER(a,f),
nq,FILTER(q,f),
fq,FREQUENCY(nq,sr),
p,INDEX(fq,sr),
nc,MAX(p),
nsa,IF(p>=SEQUENCE(,nc),SEQUENCE(r,nc)),
nsr,SMALL(nsa,SEQUENCE(SUM(p))),
rs,IFNA(XLOOKUP(nsa,nsr,na),""),
IF(xk,IFERROR(rs,IF(nf="","",nf)),"check var -1(only txt),0(no blnks),1(only nr.)")
)
)
LAMBDA 5.0.xlsx | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | a | -1 | 1 | 0 | 1 | b | a | |||
2 | 2 | -3 | c | c | 2 | 0 | ||||
3 | % | d | c | d | c | 3 | ||||
4 | ||||||||||
5 | ||||||||||
6 | a | b | a | |||||||
7 | c | c | ||||||||
8 | % | d | c | d | c | |||||
9 | ||||||||||
10 | ||||||||||
11 | a | -1 | 1 | 0 | 1 | b | a | |||
12 | 2 | -3 | c | c | 2 | 0 | ||||
13 | % | d | c | d | c | 3 | ||||
14 | ||||||||||
15 | ||||||||||
16 | -1 | 1 | 0 | 1 | ||||||
17 | 2 | -3 | 2 | 0 | ||||||
18 | 3 | |||||||||
19 | ||||||||||
AFILTER post |
Cell Formulas | ||
---|---|---|
Range | Formula | |
A6:E8 | A6 | =AFILTER(A1:G3,-1,"not found") |
A11:G13 | A11 | =AFILTER(A1:G3,0,) |
A16:D18 | A16 | =AFILTER(A1:G3,1,"") |
Dynamic array formulas. |
Last edited by a moderator:
Upvote
0