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 :)
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
 
Upvote 0
You could use Data - Text To Columns
 
Upvote 0
Thanks for your replies unfortunately I can't use text to columns that's something that needs to be done each time this needs to be a formula that sits there and splits the data as more rows are added. text split function would be ideal but I can't see it in my list of functions for some reason?
 
Upvote 0
Hi
What about a VBA?
Suppose your DATA In column a with header
VBA Code:
Sub test()
Dim a
Dim i&, k&
Dim x
    a = Range(Cells(2, 1), Cells(2, 1).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
try:
VBA Code:
Option Explicit
Sub test()
Dim k&, cell As Range, s, item
Application.ScreenUpdating = False
    For Each cell In Range("C2:C" & Cells(Rows.Count, "C").End(xlUp).Row)
        cell.Offset(1, 10).Resize(1, 26).ClearContents
        k = 0: s = Split(cell, ";")
        For Each item In s
            k = k + 1: cell.Offset(0, 9 + k).Value = item
        Next
    Next
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Formula solution:
In M2, drag accross and down:
Code:
=IFERROR(MID(SUBSTITUTE($C2,";",REPT(" ",100)),(COLUMNS($A:A)-1)*100+1,100)+0,"")
 
Upvote 0
Solution

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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