Extract multiple numbers from an horizontal string to vertical cells

JohnBi

New Member
Joined
Aug 1, 2016
Messages
31
Office Version
  1. 2019
Platform
  1. Windows
Hello to everybody
I have many of "25918, 26012, 26188,26506,26824,26964" strings where, btwn numbers there is a comma only or a comma plus a space.
Is there a formula to extract each group of numbers in a cell like the picture? At the moment I am doing "data to column" and then "copy-paste/transpose".
Thank you for your help and time.
Regards
John

 

Attachments

  • Img_excel.gif
    Img_excel.gif
    5.4 KB · Views: 10

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Hi
For one range A1
a VBA
VBA Code:
Sub test()
Dim x
x = Split(Cells(1, 1), ",")
Cells(2, 1).Resize(UBound(x)) = Application.Transpose(x)

End Sub
 
Upvote 0
Thanks for that.
How about
Fluff.xlsm
A
1
225918, 26012, 26188,26506,26824,26964
3
425918
526012
626188
726506
826824
926964
10 
11 
Master
Cell Formulas
RangeFormula
A4:A11A4=IFERROR(FILTERXML("<k><m>"&SUBSTITUTE($A$2,",","</m><m>")&"</m></k>","//m["&ROWS(A$4:A4)&"]"),"")


The formula may need to be confirmed with Ctrl Shift Enter.
 
Upvote 0
Solution
Hi,
can I ask you please to confirm the formula, as I can see some Html code:
=IFERROR(FILTERXML(SUBSTITUTE($A$2,",","),ROWS(A$4:A4)),"")

Thanks for your help.
Regards
John
 
Upvote 0
Hi
For one range A1
a VBA
VBA Code:
Sub test()
Dim x
x = Split(Cells(1, 1), ",")
Cells(2, 1).Resize(UBound(x)) = Application.Transpose(x)

End Sub
Thank you for your suggestion, it works fine.
John
 
Upvote 0
Thanks to you as well for your suggestion, it works fine and I was not aware about the "Filterxml" function. Very interesting.
John
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,028
Messages
6,122,749
Members
449,094
Latest member
dsharae57

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