AFLAT

=AFLAT(a)

a
array

"flattens" any array and filters out blanks, null strings, errors

Xlambda

Well-known Member
Joined
Mar 8, 2021
Messages
860
Office Version
  1. 365
Platform
  1. Windows
AFLAT "flattens" any array and filters out blanks, null strings, errors
Other function on minisheet AFLATTEN
Excel Formula:
=LAMBDA(a,
    LET(r,ROWS(a),c,COLUMNS(a),s,SEQUENCE(r*c),
       q,QUOTIENT(s-1,c)+1,m,MOD(s-1,c)+1,
       x,INDEX(IFERROR(IF(a="","",a),""),q,m),FILTER(x,x<>"")
    )
)
LAMBDA 10.0.xlsx
ABCDEFGHIJ
1AFLAT function, same functionality as AFLATTEN, only that filters out null strings blanks and errors
2sample↓ =""=AFLATTEN(A3:C5)=AFLAT(A3:C5)
32 #DIV/0!22
4x#N/Ax
53y#DIV/0!3
6xy
7null string#N/A
8blank
93
10
11y
12
AFLAT post
Cell Formulas
RangeFormula
E2,G2E2=FORMULATEXT(E3)
C3C3=1/0
E3:E11E3=AFLATTEN(A3:C5)
G3:G6G3=AFLAT(A3:C5)
B2B2="↓ "&FORMULATEXT(B3)
B3B3=""
B4B4=NA()
Dynamic array formulas.
 
Upvote 0
repeat product names.xlsx
ABCDEFGHIJKLMNO
1For fun, added a new "repeat" dimension, horizontally, REDUCE with VSTACK
2
3rept time
4prodverthoriz
5TATA43
6MARUTI32
7HERO24
8
9lambda formula
10=IFNA(DROP(REDUCE(0,SEQUENCE(ROWS(B5:B7)),LAMBDA(v,i,VSTACK(v,IF(SEQUENCE(INDEX(C5:C7,i),INDEX(D5:D7,i)),INDEX(B5:B7,i))))),1),"")
11TATATATATATA
12TATATATATATA
13TATATATATATA
14TATATATATATA
15MARUTIMARUTI
16MARUTIMARUTI
17MARUTIMARUTI
18HEROHEROHEROHERO
19HEROHEROHEROHERO
20
21or using REPT
22=IFNA(DROP(REDUCE(0,SEQUENCE(ROWS(B5:B7)),LAMBDA(v,i,VSTACK(v,REPT(INDEX(B5:B7,i),SEQUENCE(INDEX(C5:C7,i),INDEX(D5:D7,i))^0)))),1),"")
23TATATATATATA
24TATATATATATA
25TATATATATATA
26TATATATATATA
27MARUTIMARUTI
28MARUTIMARUTI
29MARUTIMARUTI
30HEROHEROHEROHERO
31HEROHEROHEROHERO
32
Sheet4
Cell Formulas
RangeFormula
B10,B22B10=FORMULATEXT(B11)
B11:E19B11=IFNA(DROP(REDUCE(0,SEQUENCE(ROWS(B5:B7)),LAMBDA(v,i,VSTACK(v,IF(SEQUENCE(INDEX(C5:C7,i),INDEX(D5:D7,i)),INDEX(B5:B7,i))))),1),"")
B23:E31B23=IFNA(DROP(REDUCE(0,SEQUENCE(ROWS(B5:B7)),LAMBDA(v,i,VSTACK(v,REPT(INDEX(B5:B7,i),SEQUENCE(INDEX(C5:C7,i),INDEX(D5:D7,i))^0)))),1),"")
Dynamic array formulas.
 

Forum statistics

Threads
1,223,945
Messages
6,175,555
Members
452,652
Latest member
eduedu

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