ACLEAN

=ACLEAN(a,k)

a
array
k
0 replaces errors with null strings, 1 removes only rows with errors, 2 removes rows with errors and blanks

ACLEAN cleans an array, replaces errors with null strings or removes the rows with errors or removes the rows with errors and blanks.

Xlambda

Well-known Member
Joined
Mar 8, 2021
Messages
832
Office Version
  1. 365
Platform
  1. Windows
ACLEAN cleans an array, replaces errors with null strings or removes the rows with errors or removes the rows with errors and blanks. calls AUNIQUE
Excel Formula:
=LAMBDA(a,k,
    LET(xk,OR(k={0,1,2}),
       r,ROWS(a),sr,SEQUENCE(r),
       x,ISERROR(a)*sr,y,sr*IFERROR(x+(a=""),1),
       z,AUNIQUE(SWITCH(k,0,0,1,x,2,y),),
       xm,ISNA(XMATCH(sr,z)),
       IF(xk,IFERROR(FILTER(IF(a="","",a),xm),""),"0 null strings for errors,1 removes errors only,2 removes errors and blanks")
    )
)
LAMBDA 5.0.xlsx
ABCDEFGHIJKLM
1116314661k=0116314661
221732#DIV/0!62null str.2173262
33334863for3334863
4419344964errors419344964
552035655203565
66#DIV/0!3651666365166
7722375267722375267
88236882368
9924395469924395469
1010254055#DIV/0!10254055
111126#DIV/0!567111265671
121242577212425772
1313284358731328435873
1414#DIV/0!#DIV/0!741474
1515304560751530456075
16
17k=1rmvserrorsonlyk=2rmvserrsandblnks
18116314661116314661
193334863419344964
20419344964722375267
215203565924395469
227223752671328435873
23823681530456075
24924395469
2512425772
261328435873
271530456075
28
ACLEAN post
Cell Formulas
RangeFormula
H1:L15H1=ACLEAN(A1:E15,)
D2,D14,B14,C11,E10,B6D2=1/0
A18:E27A18=ACLEAN(A1:E15,1)
H18:L23H18=ACLEAN(A1:E15,2)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,420
Messages
6,124,803
Members
449,190
Latest member
cindykay

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