ACLMSPLIT

=ACLMSPLIT(a,c,d)

a
array
c
integer, column index of the column to split, more columns require nested ACLMSPLIT, taking in consideration the new created columns index values
d
string delimiter

splits chosen column of an array, by a chosen delimiter, embedding the result with the rest of the array

Xlambda

Well-known Member
Joined
Mar 8, 2021
Messages
860
Office Version
  1. 365
Platform
  1. Windows
ACLMSPLIT splits chosen column of an array, by a chosen delimiter, embedding the result with the rest of the array. Calls ATEXTSPLIT , APPEND2H
Other function in minisheet ARANDOM
Excel Formula:
=LAMBDA(a,c,d,
    LET(l,COLUMNS(a),s,SEQUENCE(,l),
       x,INDEX(a,,c),y,ATEXTSPLIT(x,d,),z,FILTER(a,s<c),v,FILTER(a,s>c),
       IFERROR(APPEND2H(APPEND2H(z,y,),v,),"check data")
    )
)
LAMBDA 7.0.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
1sample=ACLMSPLIT(A2:E27,2,"_")=ACLMSPLIT(G2#,3," ")
201-01-21ID-16_Rey Bradly Shelton RyburnGigi6MidWest01-01-21ID-16Rey Bradly Shelton RyburnGigi6MidWest01-01-21ID-16ReyBradlySheltonRyburnGigi6MidWest
301-09-20ID-12_Alfred Jamel Poulsen MatteiSunset3MidWest01-09-20ID-12Alfred Jamel Poulsen MatteiSunset3MidWest01-09-20ID-12AlfredJamelPoulsenMatteiSunset3MidWest
401-04-20ID-5_Mel Jere Scheidler Sunset3MidWest01-04-20ID-5Mel Jere Scheidler Sunset3MidWest01-04-20ID-5MelJereScheidlerSunset3MidWest
501-02-20ID-14_Houston Grinnell LevisonMajestic6South01-02-20ID-14Houston Grinnell LevisonMajestic6South01-02-20ID-14HoustonGrinnellLevisonMajestic6South
601-11-20ID-12_Alfred Jamel Poulsen MatteiYanaki12East01-11-20ID-12Alfred Jamel Poulsen MatteiYanaki12East01-11-20ID-12AlfredJamelPoulsenMatteiYanaki12East
701-04-20ID-9_Ricky Jamel Buskirk Gigi12East01-04-20ID-9Ricky Jamel Buskirk Gigi12East01-04-20ID-9RickyJamelBuskirkGigi12East
801-01-20ID-9_Ricky Jamel Buskirk Yanaki3MidWest01-01-20ID-9Ricky Jamel Buskirk Yanaki3MidWest01-01-20ID-9RickyJamelBuskirkYanaki3MidWest
901-01-21ID-4_Freddie Jere Otten LevisonQuad3Mexico01-01-21ID-4Freddie Jere Otten LevisonQuad3Mexico01-01-21ID-4FreddieJereOttenLevisonQuad3Mexico
1001-11-20ID-7_Houston Arnoldo Ybarbo Majestic12MidWest01-11-20ID-7Houston Arnoldo Ybarbo Majestic12MidWest01-11-20ID-7HoustonArnoldoYbarboMajestic12MidWest
1101-09-20ID-11_Theodore Grinnell SpethYanaki12East01-09-20ID-11Theodore Grinnell SpethYanaki12East01-09-20ID-11TheodoreGrinnellSpethYanaki12East
1201-12-20ID-12_Alfred Jamel Poulsen MatteiYanaki18Canada01-12-20ID-12Alfred Jamel Poulsen MatteiYanaki18Canada01-12-20ID-12AlfredJamelPoulsenMatteiYanaki18Canada
1301-05-20ID-4_Freddie Jere Otten LevisonMajestic3East01-05-20ID-4Freddie Jere Otten LevisonMajestic3East01-05-20ID-4FreddieJereOttenLevisonMajestic3East
1401-07-20ID-5_Mel Jere Scheidler Crested6Canada01-07-20ID-5Mel Jere Scheidler Crested6Canada01-07-20ID-5MelJereScheidlerCrested6Canada
1501-04-21ID-12_Alfred Jamel Poulsen MatteiQuad12South01-04-21ID-12Alfred Jamel Poulsen MatteiQuad12South01-04-21ID-12AlfredJamelPoulsenMatteiQuad12South
1601-12-20ID-9_Ricky Jamel Buskirk Crested3West01-12-20ID-9Ricky Jamel Buskirk Crested3West01-12-20ID-9RickyJamelBuskirkCrested3West
1701-02-20ID-17_Rudolf Bradly Garth Sunset3NorthWest01-02-20ID-17Rudolf Bradly Garth Sunset3NorthWest01-02-20ID-17RudolfBradlyGarthSunset3NorthWest
1801-02-20ID-19_Houston Myron Enderle Majestic18East01-02-20ID-19Houston Myron Enderle Majestic18East01-02-20ID-19HoustonMyronEnderleMajestic18East
1901-12-20ID-4_Freddie Jere Otten LevisonSunset3NorthWest01-12-20ID-4Freddie Jere Otten LevisonSunset3NorthWest01-12-20ID-4FreddieJereOttenLevisonSunset3NorthWest
2001-04-20ID-18_Eduardo Jarrod Dawkins FogleQuad18Canada01-04-20ID-18Eduardo Jarrod Dawkins FogleQuad18Canada01-04-20ID-18EduardoJarrodDawkinsFogleQuad18Canada
2101-01-21ID-15_Vance Harry Garth LevisonYanaki18South01-01-21ID-15Vance Harry Garth LevisonYanaki18South01-01-21ID-15VanceHarryGarthLevisonYanaki18South
2201-02-20ID-19_Houston Myron Enderle Gigi3South01-02-20ID-19Houston Myron Enderle Gigi3South01-02-20ID-19HoustonMyronEnderleGigi3South
2301-04-21ID-11_Theodore Grinnell SpethGigi12MidWest01-04-21ID-11Theodore Grinnell SpethGigi12MidWest01-04-21ID-11TheodoreGrinnellSpethGigi12MidWest
2401-02-20ID-4_Freddie Jere Otten LevisonSunset6MidWest01-02-20ID-4Freddie Jere Otten LevisonSunset6MidWest01-02-20ID-4FreddieJereOttenLevisonSunset6MidWest
2501-08-20ID-18_Eduardo Jarrod Dawkins FogleSunset6South01-08-20ID-18Eduardo Jarrod Dawkins FogleSunset6South01-08-20ID-18EduardoJarrodDawkinsFogleSunset6South
2601-02-20ID-6_Jesus Pasquariello RyburnYanaki18Mexico01-02-20ID-6Jesus Pasquariello RyburnYanaki18Mexico01-02-20ID-6JesusPasquarielloRyburnYanaki18Mexico
2701-02-20ID-1_Theodore Kriger RyburnMajestic12NorthWest01-02-20ID-1Theodore Kriger RyburnMajestic12NorthWest01-02-20ID-1TheodoreKrigerRyburnMajestic12NorthWest
28
29Very useful when we need to create random array of products that haveother function on minisheet
30for example, unit prices, because can not be shuffled, they should remain consistentARANDOM
31or, like in the above array, the ID nr associated with names, should remain uniqueSince left array recalculates, we copy it as values, and, adding the headers, we obtain a nice useful random array
32DateID-nr_NameProd.,Unt PricePack.RegionDateID-nrNameProd.Unt.PricePack.RegionUnt.SoldTotal
33sample=ACLMSPLIT(ACLMSPLIT(ARANDOM(A34:E59,20),2,"_"),4,",")=RANDARRAY(ROWS(G34#),,2,10,1)DateID-nrNameProd.Unt.PricePack.RegionUnt.SoldTotal
3401-01-21ID-1_Theodore Kriger RyburnQuad,20.53West01-02-20ID-11Theodore Grinnell SpethYanaki10.212South6734.401-02-20ID-4Freddie Jere Otten LevisonQuad20.53MidWest9553.5
3501-09-20ID-2_Antione Myron Scheidler FogleMajestic,17.36South01-04-21ID-19Houston Myron Enderle Quad20.56NorthWest10123001-02-20ID-19Houston Myron Enderle Sunset14.818West92397.6
3601-04-20ID-3_Antione Grinnell Yanaki,10.212MidWest01-04-20ID-19Houston Myron Enderle Quad20.56West786101-05-20ID-14Houston Grinnell LevisonQuad20.512NorthWest71722
3701-02-20ID-4_Freddie Jere Otten LevisonCrested,9.8518Canada01-01-21ID-6Jesus Pasquariello RyburnGigi18.76Canada10112201-02-20ID-20Mel Jamel Valtierra HogeQuad20.56West3369
3801-11-20ID-5_Mel Jere Scheidler Sunset,14.8Mexico01-05-20ID-17Rudolf Bradly Garth Yanaki10.23South4122.401-08-20ID-1Theodore Kriger RyburnYanaki10.218NorthWest3550.8
3901-04-20ID-6_Jesus Pasquariello RyburnGigi,18.7NorthWest01-07-20ID-2Antione Myron Scheidler FogleMajestic17.312Canada71453.201-11-20ID-8Rey Myron Mcglothlin MatteiMajestic17.312NorthWest4830.4
4001-01-20ID-7_Houston Arnoldo Ybarbo East01-11-20ID-6Jesus Pasquariello RyburnCrested9.8518MidWest71241.101-02-20ID-19Houston Myron Enderle Sunset14.83NorthWest10444
4101-01-21ID-8_Rey Myron Mcglothlin Mattei01-02-20ID-10Mel Bradly Buskirk Gigi18.76Mexico8897.601-01-21ID-5Mel Jere Scheidler Yanaki10.23East261.2
4201-11-20ID-9_Ricky Jamel Buskirk 01-12-20ID-8Rey Myron Mcglothlin MatteiSunset14.86Canada4355.201-04-21ID-1Theodore Kriger RyburnCrested9.856Mexico6354.6
4301-09-20ID-10_Mel Bradly Buskirk 01-01-20ID-3Antione Grinnell Majestic17.312Canada81660.801-04-20ID-12Alfred Jamel Poulsen MatteiYanaki10.218MidWest3550.8
4401-12-20ID-11_Theodore Grinnell Speth01-01-21ID-1Theodore Kriger RyburnSunset14.86Mexico2177.601-02-20ID-14Houston Grinnell LevisonGigi18.718MidWest72356.2
4501-05-20ID-12_Alfred Jamel Poulsen Mattei01-02-20ID-20Mel Jamel Valtierra HogeYanaki10.212MidWest2244.801-02-20ID-1Theodore Kriger RyburnQuad20.512MidWest102460
4601-07-20ID-13_Rey Jamel Dawkins Fogle01-02-20ID-16Rey Bradly Shelton RyburnSunset14.83Mexico4177.601-04-21ID-12Alfred Jamel Poulsen MatteiGigi18.76Canada6673.2
4701-04-21ID-14_Houston Grinnell Levison01-02-20ID-11Theodore Grinnell SpethGigi18.718Canada62019.601-02-20ID-11Theodore Grinnell SpethSunset14.812South3532.8
4801-12-20ID-15_Vance Harry Garth Levison01-04-21ID-6Jesus Pasquariello RyburnCrested9.856Mexico2118.201-02-20ID-15Vance Harry Garth LevisonMajestic17.36Mexico3311.4
4901-02-20ID-16_Rey Bradly Shelton Ryburn01-09-20ID-14Houston Grinnell LevisonSunset14.818West71864.801-01-21ID-2Antione Myron Scheidler FogleQuad20.518MidWest41476
5001-02-20ID-17_Rudolf Bradly Garth 01-02-20ID-14Houston Grinnell LevisonYanaki10.26Mexico6367.201-12-20ID-4Freddie Jere Otten LevisonGigi18.76MidWest3336.6
5101-12-20ID-18_Eduardo Jarrod Dawkins Fogle01-02-20ID-5Mel Jere Scheidler Majestic17.318NorthWest92802.601-02-20ID-12Alfred Jamel Poulsen MatteiQuad20.53MidWest8492
5201-04-20ID-19_Houston Myron Enderle 01-04-20ID-6Jesus Pasquariello RyburnYanaki10.23Mexico8244.801-02-20ID-9Ricky Jamel Buskirk Yanaki10.23Canada7214.2
5301-01-21ID-20_Mel Jamel Valtierra Hoge01-04-20ID-16Rey Bradly Shelton RyburnSunset14.86West3266.401-04-20ID-4Freddie Jere Otten LevisonQuad20.56MidWest101230
5401-02-20=K34:K53*L34:L53*N34:N53
5501-04-21ID nr consistent with NamePrduct consistent with Unit Price
5601-02-20(ex:ID-1 always associated with Theodore…)(ex:Quad price always 20.5)
5701-08-20
5801-02-20
5901-02-20
60
ACLMSPLIT post
Cell Formulas
RangeFormula
G1,N33,G33,N1G1=FORMULATEXT(G2)
G2:L27G2=ACLMSPLIT(A2:E27,2,"_")
N2:V27N2=ACLMSPLIT(G2#,3," ")
G34:M53G34=ACLMSPLIT(ACLMSPLIT(ARANDOM(A34:E59,20),2,"_"),4,",")
N34:N53N34=RANDARRAY(ROWS(G34#),,2,10,1)
O34:O53O34=K34:K53*L34:L53*N34:N53
O54O54=FORMULATEXT(O34)
Dynamic array formulas.
 
Upvote 0
Improved function by adding default functionality for column index argument (cl=0 or ignored will split the last column of the array) and error handling. Calls ATEXTSPLIT , APPEND2H
a: array , cl: integer, column index of column to split, 0 or ignored will split the last column , d: string, delimiter
Other function in minisheet ARANDOM , ACLMJOIN
Excel Formula:
=LAMBDA(a,cl,d,
    LET(l,COLUMNS(a),s,SEQUENCE(,l),c,IF(cl,cl,l),x,INDEX(a,,c),y,ATEXTSPLIT(x,d,),z,FILTER(a,s<c),v,FILTER(a,s>c),
       IFERROR(IFS(AND(c=1,l=1),y,c=1,APPEND2H(y,v,),OR(c=0,c=l),APPEND2H(z,y,),TRUE,APPEND2H(APPEND2H(z,y,),v,)),"check data")
    )
)
LAMBDA 8.0.xlsx
ABCDEFGHIJKLMNOPQRSTUVWX
1added default value for column argument, (0 or ignored, last column will get splitted) and some error handling
2sample to create random data arraydata joining,nested ACLMJOIN formulaslink ACLMJOIN post
3ProductBrandTypeCost/uS.Price/uSale RepShopRegionManager=ACLMJOIN(ACLMJOIN(A4:I18,1,5,,-1,"|"),3,,,,"|")
4ID-3Samsungphone230300Mel DawkinsShop CEastJohn SID-3|Samsung|phone|230|300Mel DawkinsShop C|East|John S
5ID-6Samsungtablet170240Winford FilerShop BWestDavid MID-6|Samsung|tablet|170|240Winford FilerShop B|West|David M
6ID-4Applephone350470Miguel ValtierraShop AEastJohn SID-4|Apple|phone|350|470Miguel ValtierraShop A|East|John S
7ID-1Appletablet280350Hollis SheltonShop DWestMike BID-1|Apple|tablet|280|350Hollis SheltonShop D|West|Mike B
8ID-7Samsunglaptop650780Davis PasquarielloShop ENorthBill TID-7|Samsung|laptop|650|780Davis PasquarielloShop E|North|Bill T
9ID-8Applelaptop420510Houston GrinnellShop FSouthSteve JID-8|Apple|laptop|420|510Houston GrinnellShop F|South|Steve J
10ID-2HPlaptop520620Antione DechantID-2|HP|laptop|520|620Antione Dechant
11ID-5HPdesktop570695Theodore PozoID-5|HP|desktop|570|695Theodore Pozo
12ID-9Appledesktop810999Vance McglothlinID-9|Apple|desktop|810|999Vance Mcglothlin
13Lindsey BuskirkLindsey Buskirk
14Rudolf OttenRudolf Otten
15Ricky KittermanRicky Kitterman
16Jesus GarthJesus Garthrandom array created consistent with initial data
17Tom EnderleTom Enderlefirst nested formula, cl argument 1
18Freddie PoulsenFreddie Poulsensecond nested formula, cl argument ignored (0) (splits last column)
19random array with joined values=ACLMSPLIT(ACLMSPLIT(K21#,1,"|"),,"|")
20=ARANDOM(K4#,20)ProductBrandTypeCost/uS.Price/uSale RepShopRegionManager
21simple functionality explainedID-1|Apple|tablet|280|350Miguel ValtierraShop E|North|Bill TID-1Appletablet280350Miguel ValtierraShop ENorthBill T
22sampleID-4|Apple|phone|350|470Antione DechantShop E|North|Bill TID-4Applephone350470Antione DechantShop ENorthBill T
23A,10,xredX,Y,ZID-6|Samsung|tablet|170|240Antione DechantShop D|West|Mike BID-6Samsungtablet170240Antione DechantShop DWestMike B
24B,20,yblueID-1|Apple|tablet|280|350Vance McglothlinShop B|West|David MID-1Appletablet280350Vance McglothlinShop BWestDavid M
25C,30,ygreenT,U,VID-4|Apple|phone|350|470Jesus GarthShop B|West|David MID-4Applephone350470Jesus GarthShop BWestDavid M
26ID-1|Apple|tablet|280|350Theodore PozoShop E|North|Bill TID-1Appletablet280350Theodore PozoShop ENorthBill T
27=ACLMSPLIT(A23:C25,1,",")ID-6|Samsung|tablet|170|240Hollis SheltonShop B|West|David MID-6Samsungtablet170240Hollis SheltonShop BWestDavid M
28cl=1ID-1|Apple|tablet|280|350Winford FilerShop C|East|John SID-1Appletablet280350Winford FilerShop CEastJohn S
29A10xredX,Y,ZID-9|Apple|desktop|810|999Freddie PoulsenShop D|West|Mike BID-9Appledesktop810999Freddie PoulsenShop DWestMike B
30B20yblueID-6|Samsung|tablet|170|240Ricky KittermanShop B|West|David MID-6Samsungtablet170240Ricky KittermanShop BWestDavid M
31C30ygreenT,U,VID-2|HP|laptop|520|620Hollis SheltonShop F|South|Steve JID-2HPlaptop520620Hollis SheltonShop FSouthSteve J
32ID-3|Samsung|phone|230|300Rudolf OttenShop D|West|Mike BID-3Samsungphone230300Rudolf OttenShop DWestMike B
33=ACLMSPLIT(A23:C25,,",")ID-4|Apple|phone|350|470Hollis SheltonShop F|South|Steve JID-4Applephone350470Hollis SheltonShop FSouthSteve J
34cl ignored (or 0)ID-1|Apple|tablet|280|350Antione DechantShop B|West|David MID-1Appletablet280350Antione DechantShop BWestDavid M
35A,10,xredXYZID-1|Apple|tablet|280|350Lindsey BuskirkShop A|East|John SID-1Appletablet280350Lindsey BuskirkShop AEastJohn S
36B,20,yblueID-2|HP|laptop|520|620Winford FilerShop F|South|Steve JID-2HPlaptop520620Winford FilerShop FSouthSteve J
37C,30,ygreenTUVID-9|Apple|desktop|810|999Mel DawkinsShop A|East|John SID-9Appledesktop810999Mel DawkinsShop AEastJohn S
38ID-1|Apple|tablet|280|350Mel DawkinsShop A|East|John SID-1Appletablet280350Mel DawkinsShop AEastJohn S
39=ACLMSPLIT(ACLMSPLIT(A23:C25,1,","),,",")ID-2|HP|laptop|520|620Theodore PozoShop D|West|Mike BID-2HPlaptop520620Theodore PozoShop DWestMike B
40nestedID-6|Samsung|tablet|170|240Mel DawkinsShop A|East|John SID-6Samsungtablet170240Mel DawkinsShop AEastJohn S
41A10xredXYZ
42B20yblue
43C30ygreenTUV
44
ACLMSPLIT post2
Cell Formulas
RangeFormula
K3,K20K3=FORMULATEXT(K4)
K4:M18K4=ACLMJOIN(ACLMJOIN(A4:I18,1,5,,-1,"|"),3,,,,"|")
O19,A39,A33,A27O19=FORMULATEXT(O21)
K21:M40K21=ARANDOM(K4#,20)
O21:W40O21=ACLMSPLIT(ACLMSPLIT(K21#,1,"|"),,"|")
A29:E31A29=ACLMSPLIT(A23:C25,1,",")
A35:E37A35=ACLMSPLIT(A23:C25,,",")
A41:G43A41=ACLMSPLIT(ACLMSPLIT(A23:C25,1,","),,",")
Dynamic array formulas.
 

Forum statistics

Threads
1,224,836
Messages
6,181,252
Members
453,028
Latest member
letswriteafairytale

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