ATTSPLIT

=ATTSPLIT(a)

a
array,1D(vertical)

Array To Text Split , splits back to arrays an array of data obtained by ARRAYTOTEXT function, format argument 1

Xlambda

Well-known Member
Joined
Mar 8, 2021
Messages
860
Office Version
  1. 365
Platform
  1. Windows
ATTSPLIT Array To Text Split , splits back to arrays an array of data obtained by ARRAYTOTEXT function, format argument 1 .
Inspired by ExcelIsFun YT video Join text items in a cell using TEXTJOIN or ARRAYTOTEXT functions. Excel Magic Trick 1741
Other functions on minisheet: AREMOVE , ATEXTSPLIT , AKEEP , AFLAT ASTACK
Excel Formula:
=LAMBDA(a,
    LET(k,OR(ISERROR(SEARCH(";",a))),
       IF(k,"not proper data format",ATEXTSPLIT(AFLAT(ATEXTSPLIT(AREMOVE(a,"{}""""",),";",1)),",",1))
    )
)
LAMBDA 10.0.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAH
1sample arrayb2y
2gh
343
4Post 1
5Functionality of ARRAYTOTEXTWays to get to initial array
6format argument 0 or omittedstep 1step 2step 3
7=ARRAYTOTEXT(B1:E3)remove spacessplit with ATEXTSPLIT",",include empty=1we need an unknow extra argument
8, b, 2, y, g, , , h, 4, 3, , =AREMOVE(A8," ",)=ATEXTSPLIT(G9,",",1)for array width,(ASTACK argument)
9The function adds a space btwn values,b,2,y,g,,,h,4,3,, b2ygh43=ASTACK(K9#,4)
10and "," delimiter b2y
11The blanks will become spacesgh
1243
13format argument 1step 1step 2step 3
14=ARRAYTOTEXT(B1:E3,1)remove {}" charssplit with ATEXTSPLIT for ";" del.split with ATEXTSPLIT "," del.
15{,"b",2,"y";"g",,,"h";4,3,,}=AREMOVE(A15,"{}""""",)and stack the results with AFLATinclude empty argument=1
16No spaces added btwn,b,2,y;g,,,h;4,3,,=AFLAT(ATEXTSPLIT(G16,";",))=ATEXTSPLIT(P17#,",",1)
17delimiter and valuesNote:,b,2,y b2y
18We get a";" at the endTo include " as char to be removedg,,,hgh
19of each rowwe have to use 4 x" , as in """"4,3,,43
20Text values btwn quotes
21Other approach is to find out nr of columns of the array
22othe functions on minisheetthat will be nr of "," up to first ";", using AKEEP only ",;" chars and SEARCH position of ";"
23AREMOVE=AKEEP(G16,",;",)=SEARCH(";",G24)
24ATEXTSPLIT,,,;,,,;,,,4
25AKEEPsubstitute ";" with ",", ATEXTSPLIT for ","
26AFLATand ASTACK for nr of columns, like first scenario
27ASTACK=SUBSTITUTE(G16,";",",")=ATEXTSPLIT(G28,",",1)=ASTACK(L28#,L24)
28,b,2,y,g,,,h,4,3,, b2ygh43 b2y
29gh
3043
31
ATTSPLIT post 1
Cell Formulas
RangeFormula
A7,Y27,L27,G27,L23,G23,X16,P16,G15,A14,X9,K8,G8A7=FORMULATEXT(A8)
A8A8=ARRAYTOTEXT(B1:E3)
G9G9=AREMOVE(A8," ",)
K9:V9K9=ATEXTSPLIT(G9,",",1)
X10:AA12X10=ASTACK(K9#,4)
A15A15=ARRAYTOTEXT(B1:E3,1)
G16G16=AREMOVE(A15,"{}""""",)
P17:P19P17=AFLAT(ATEXTSPLIT(G16,";",))
X17:AA19X17=ATEXTSPLIT(P17#,",",1)
G24G24=AKEEP(G16,",;",)
L24L24=SEARCH(";",G24)
G28G28=SUBSTITUTE(G16,";",",")
L28:W28L28=ATEXTSPLIT(G28,",",1)
Y28:AB30Y28=ASTACK(L28#,L24)
Dynamic array formulas.
 
Upvote 0
Post 2. Other functions on minisheet AREMOVE , ATEXTSPLIT , AFLAT
LAMBDA 10.0.xlsx
ABCDEFGHIJKLMNOPQRSTUVWX
1Post 2: Handling an array of arraytotext data
2If we get data obtained with arraytotext format argument=0, there is no way to determine the initial arrays dimensions, so this scenario
3can be covered combining other functions AREMOVE ATEXTSPLIT ASTACK, like in previous post.
4For that reason ATTSPLIT function will cover only data in the format obtained by arraytotext format argument=1( has row separators";").
5This ensures that the result will be consistent with the initial arrays.
6
7arraytotext data, format arg.=1, coming from 3 arraysarray 1array 2array 3
8=ARRAYTOTEXT(I8:L10,1)Initial arraysb2yABCDabc123
9{,"b",2,"y";"g",,,"h";4,3,,}different dimensionsgh23def456ghi
10{"AB",,"CD";,23,;,"EF",;"GH",45,}43EF
11{,"abc",,123,;"def",,456,,"ghi"}GH45
12all steps in a function
13step 1: remove {}" charsstep 2: ATEXTSPLIT for ";" (row delim.)step 3: AFLATstep 4: ATEXTSPLIT for "," (clms delim.)ATTSPLIT function
14=AREMOVE(A9:A11," {}""""",)=ATEXTSPLIT(A15#,";",1)=AFLAT(C15#)=ATEXTSPLIT(H15#,",",1)=ATTSPLIT(A9:A11)
15,b,2,y;g,,,h;4,3,,,b,2,yg,,,h4,3,,,b,2,y b2y b2y
16AB,,CD;,23,;,EF,;GH,45,AB,,CD,23,,EF,GH,45,g,,,hghgh
17,abc,,123,;def,,456,,ghi,abc,,123,def,,456,,ghi4,3,,4343
18AB,,CDABCDABCD
19,23,2323
20othe functions on minisheet,EF,EFEF
21AREMOVEGH,45,GH45GH45
22ATEXTSPLIT,abc,,123,abc123abc123
23AFLATdef,,456,,ghidef456ghidef456ghi
24
25Alternative formula to reproduce ARRAYTOTEXT functionality (with row separators)
26=LAMBDA(a,LET(c,COLUMNS(a),s,SEQUENCE(,c),x,SWITCH(s,c,a&";",a&","),y,TEXTJOIN(,,x),LEFT(y,LEN(y)-1)))(I8:L10)
27
28=ATTSPLIT(A29)
29,b,2,y;g,,,h;4,3,, b2y
30gh
31Error debug.43
32If not proper data set
33(no rows separators ";")
34,b,2,y,g,,,h,4,3,,
35
36=ATTSPLIT(A34)
37not proper data format
38
ATTSPLIT post 2
Cell Formulas
RangeFormula
A8,A36,C28,A14,S14,H14,J14,C14A8=FORMULATEXT(A9)
A9A9=ARRAYTOTEXT(I8:L10,1)
A10A10=ARRAYTOTEXT(N8:P11,1)
A11A11=ARRAYTOTEXT(R8:V9,1)
A15:A17A15=AREMOVE(A9:A11," {}""""",)
C15:F17C15=ATEXTSPLIT(A15#,";",1)
H15:H23H15=AFLAT(C15#)
J15:N23J15=ATEXTSPLIT(H15#,",",1)
S15:W23S15=ATTSPLIT(A9:A11)
A26A26=FORMULATEXT(A29)
A29A29=LAMBDA(a,LET(c,COLUMNS(a),s,SEQUENCE(,c),x,SWITCH(s,c,a&";",a&","),y,TEXTJOIN(,,x),LEFT(y,LEN(y)-1)))(I8:L10)
C29:F31C29=ATTSPLIT(A29)
A37A37=ATTSPLIT(A34)
Dynamic array formulas.
 

Forum statistics

Threads
1,223,604
Messages
6,173,315
Members
452,510
Latest member
RCan29

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