Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Delimit Cells in Excel with Click-and-Drag Formula

I have the following in Cell B1:

AB,1,CD,3,EFG,3,

I have a formula that splits the cell up by delimiter , and allows me to click and drag this horizontally to as many cells as I’d like.

The formula that allows me to click and drag, in cell C1, is the following:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

=TRIM(MID(SUBSTITUTE($B1,",",REPT(" ",LEN($B1))),(COLUMNS($C1:C1)-1)*LEN($B1)+1,LEN($B1)))

A problem that I’m running into now is that I essentially have two different delimters in Cell B6. Expected output would be the same as what’s stated in Cells C1:K1, except I need an updated formula that will split by ( and )

enter image description here

An excel formula solution is needed — most likely just tweaking my current formula I’ve provided above. No macro solutions, please.

>Solution :

To use a formula for both cases, you can use this:

=LET(fixedBracket1,SUBSTITUTE($B1,"(",","),
fixedBracket2,SUBSTITUTE(fixedBracket1,")",","),
TRIM(MID(SUBSTITUTE(fixedBracket2,",",REPT(" ",LEN(fixedBracket2))),(COLUMNS($C1:C1)-1)*LEN(fixedBracket2)+1,LEN(fixedBracket2))))

It first replaces all (-Brackets with a comma, then all )-Brackets.

If you are on the Insider channel you could use TEXTSPLIT

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading