AFILTER

=AFILTER(ar,k,nf)

ar
required. array to be filtered
k
required. filter argument -1 text, 0 non blanks, 1 numbers
nf
optional. string message if not found

AFILTER filters array by rows, text, non blanks or numbers, left aligned.

Xlambda

Well-known Member
Joined
Mar 8, 2021
Messages
860
Office Version
  1. 365
Platform
  1. 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
ABCDEFGH
1a-1101ba
22-3cc20
3%dcdc3
4
5
6aba
7cc
8%dcdc
9
10
11a-1101ba
122-3cc20
13%dcdc3
14
15
16-1101
172-320
183
19
AFILTER post
Cell Formulas
RangeFormula
A6:E8A6=AFILTER(A1:G3,-1,"not found")
A11:G13A11=AFILTER(A1:G3,0,)
A16:D18A16=AFILTER(A1:G3,1,"")
Dynamic array formulas.
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,088
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top