How to split numbers separated by semicolons in a cell?

Sparty2319

New Member
Joined
Apr 2, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I have a number string in cell A1 that looks something like this:

12; 34; 56; 78; 90

I would like to extract each number into cells A2, A3, A4, A5, and A6, respectively. After extracting, cell A2 should contain 12, A3 34, and so on.

Thank you very much for your help.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi,

A2 formula converts result to Real Numbers
B2 formula results as Text, in case you have leading zeros you need retained:

Book3.xlsx
AB
112; 34; 56; 78; 90
21212
33434
45656
57878
69090
7  
8  
Sheet891
Cell Formulas
RangeFormula
A2:A8A2=IFERROR(MID(SUBSTITUTE(";"&A$1,";",REPT(" ",100)),ROWS(A$2:A2)*100,100)+0,"")
B2:B8B2=TRIM(MID(SUBSTITUTE(";"&A$1,";",REPT(" ",100)),ROWS(B$2:B2)*100,100))
 
Upvote 0
Solution
Select A1, then do Text to Columns using ; as the delim and placement starting in B2.
But that will put the results in B2:F2, however.
So, you could then select those cells, copy, and with the A2 cell selected, paste special transpose.
 
Last edited:
Upvote 0
@kweaver , think OP want the results down column, in separate rows, rather then across column, in one row.
 
Upvote 0
If you could have a lot of numbers in cell A1 and were willing to use a macro, this one would work...
VBA Code:
Sub SplitDownCellA1()
  [A2:A1000] = Application.Transpose(Split([A1] & String(999, ";"), ";"))
End Sub
Note
----------------------

As written, this code will handle up to a maximum of 999 delimited numbers in cell A1. Also note that you do not have to clear the cells below cell A1 if you change the value in cell A1 as the macro will do that automatically.
 
Upvote 0
You can also do this with a single formula in a single cell.
If the numbers are all 2 digits like your example then just use the formula show in A2. The other results will automatically 'spill' down the required number of cells.
If the numbers can vary in length, then use the formula in B2. Again the other results will automatically spill down

21 04 03.xlsm
AB
112; 34; 56; 78; 9015; 88; 256; 2356
21215
33488
456256
5782356
690
7
Split values
Cell Formulas
RangeFormula
A2:A6A2=MID(A1,SEQUENCE(5,,,4),2)+0
B2:B5B2=FILTERXML("<p><c>"&SUBSTITUTE(B1,"; ","</c><c>")&"</c></p>","//c")
Dynamic array formulas.
 
Upvote 0
As a UDF with string in A1, use formula commented and drag down. Put UDF in a Module.
Excel Formula:
'=IFERROR(field($A$1,ROW()-1),"")
Function Field(cell, pos As Integer, Optional delimit As String = ";")
  Dim a() As String
  a() = Split(cell, delimit)
  Field = a(pos - 1)
End Function
 
Upvote 0

Forum statistics

Threads
1,224,737
Messages
6,180,653
Members
452,992
Latest member
TokugawaIesuma

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