SPLITBYANY

=SPLITBYANY(text, chars)

text
the text to be split
chars
the characters to be used to split the text

SPLITBYANY will split a text string by all the characters in the second argument

lrobbo314

Well-known Member
Joined
Jul 14, 2008
Messages
3,929
Office Version
  1. 365
Platform
  1. Windows
SPLITBYANY will split a text string by all the characters in the second argument.

The 'chars' argument is passed as an array separated by semicolons, e.g. {", " ; "; "}

Excel Formula:
=LAMBDA(text,chars,
    TEXTSPLIT(
        INDEX(
            REDUCE(text,
                SEQUENCE(ROWS(chars)),
                LAMBDA(s,c,
                    SUBSTITUTE(s,INDEX(chars,c),"ƛ"))
            )
            ,1
        ),,
        "ƛ"
    )
)

SPLITBYANY
AB
1Input
2Bill Jelen, bill.jelen@mrexcel.com; Mike Girvin, mike.girvin@excelisfun.com
3
4Output
5NameEmail
6Bill Jelenbill.jelen@mrexcel.com
7Mike Girvinmike.girvin@excelisfun.com
Sheet1
Cell Formulas
RangeFormula
A6:B7A6=WRAPROWS(SPLITBYANY(A2,{", ";"; "}),2)
Dynamic array formulas.
 
Upvote 0
Hi, TEXTSPLIT has native functionality to split by "any" by col and/or by row
Book1.xlsx
ABCDEFGHI
1
2B J; bj@m.com, M G/ mg@e.com,A B: ab@x.com| C D ; cd@x.com
3
4=TRIM(TEXTSPLIT(B2,{";",":","/"},{",","|"}))
5B Jbj@m.com
6M Gmg@e.com
7A Bab@x.com
8C Dcd@x.com
9
Sheet1
Cell Formulas
RangeFormula
B4B4=FORMULATEXT(B5)
B5:C8B5=TRIM(TEXTSPLIT(B2,{";",":","/"},{",","|"}))
Dynamic array formulas.
 
Well, I'll be damned. Didn't know you could do that with TEXTSPLIT. (y)
 

Forum statistics

Threads
1,216,503
Messages
6,131,022
Members
449,616
Latest member
PsychoCube

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