Split by delimiter question

LearnerD

New Member
Joined
Oct 21, 2014
Messages
27
I have looked at other questions but haven't quite found the answer I need.

I have a column with data in it split by delimiter ; 1;4;10;23; etc.. each row could have anything from 1 to 26 items in that column all split by delimiter
I have 26 columns set up to take the data one column for each item.

How do I get the split data into each column !!

So for example: my delimited data 1;3;15;23 is in field C2

I have columns M2 N2 O2 etc..up to 26 fields waiting for the info.

in field M2 I would like to see 1 in field N2 I would like to see 3 In field O2 I would like to see 15 etc.. etc.. where there is no data to fill (so in this example Q2 would have nothing, I would like to see either 0 or blank don't mind which.

Hoping you can help

Thanks in advance :)
 
If you have M365, in M2:

Excel Formula:
=TRANSPOSE(FILTERXML("<a><b>"&SUBSTITUTE(C2,";","</b><b>")&"</b></a>","//b"))

and clear anything currently in N2 and to the right.
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Ahh for data in column C Then
VBA Code:
Sub test()
Dim a
Dim i&, k&
Dim x
    a = Range(Cells(2, 3), Cells(2, 3).End(xlDown))
    For i = 1 To UBound(a)
        x = Split(a(i, 1), ";")
        Cells(i + 1, 13).Resize(, UBound(x) + 1) = x
    Next
End Sub
 
Upvote 0
So I have found this which helps me get the first one

=LEFT(C3,FIND(";",C3)-1)

but can't figure how to extrapolate out to get the next one? and so on
 
Upvote 0
I think I'm nearly there?

If I use as above but change the number at the end to a plus for example 2 it will show me the first 2 items...

=LEFT($C$3,FIND(";",$C$3)+2)

However I need to then subtract the first item so that I'm only seeing the second? and so on in each cell .. how do I do that?
 
Upvote 0
Which version of Office do you have?
 
Upvote 0
looks good ! but just returns a blank?
It works for me! Starts from M2.

1652262134611.png
 
Upvote 0
If you have M365, in M2:

Excel Formula:
=TRANSPOSE(FILTERXML("<a><b>"&SUBSTITUTE(C2,";","</b><b>")&"</b></a>","//b"))

and clear anything currently in N2 and to the right.
Great so that works for M3 but what do I put in N, O, P etc.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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