Forum Discussion
tonyceccato
Microsoft
Jan 23, 2026Help with a Formula
Below is a formula I created to return specified rows and columns for a sheet named Detail and in the case or column 49 detect if there are comma separated values and explode them into separate colum...
VBasic2008
Jan 24, 2026Brass Contributor
Split Column by Delimiter
Since you are trying to split 2 columns by delimiter, it's a good idea to create a Lambda function to do this:
=LAMBDA(c,d,LET(
n,CountD(c,d),
m,MAX(n)+1,
TEXTBEFORE(TEXTAFTER(d&c&REPT(d,m-n),d,
SEQUENCE(,m)),d)))Using the Name Manager, you could define a name, e.g., SplitD and copy the formula above into the RefersTo box.
Similarly, since you are doing your 'non-breaking space business' several times, you could create the following Lambda function named, e.g. Nbs:
=LAMBDA(a,TRIM(SUBSTITUTE(a,CHAR(160),"")))
I kept the functions inside the formula so you need not bother at the moment.
=LET(a,Detail!A2:BZ21,b,$B$16:$B$25,
Nbs,LAMBDA(a,TRIM(SUBSTITUTE(a,CHAR(160),""))),
SplitD,LAMBDA(c,d,LET(
n,LEN(c)-LEN(SUBSTITUTE(c,d,)),
m,MAX(n)+1,
TEXTBEFORE(TEXTAFTER(d&c&REPT(d,m-n),d,
SEQUENCE(,m)),d))),
ia,Nbs(CHOOSECOLS(a,49))<>"",
ib,COUNTIF(b,CHOOSECOLS(a,68))>0,
f,FILTER(a,ia*ib),
base,CHOOSECOLS(f,1,3,4,5,68),
cAW,TRIM(SplitD(Nbs(CHOOSECOLS(f,49)),",")),
cBA,TRIM(SplitD(Nbs(CHOOSECOLS(f,53)),",")),
r,SORT(UNIQUE(HSTACK(base,cAW,cBA)),1,1),
r)I would strongly suggest you put your data into a table and use structured references instead of utilizing column indices.