How do I separate numbers separated by dashes into columns with a formula

jmkelly1988

New Member
Joined
Dec 7, 2016
Messages
19
I need to split numbers separated by dashes into different columns.

Some are like 6e5-44352-01
and some are like 90430-08020

The number of dashes can be up to five in a sequence. Any help would be
greatly appreciated.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Momentman

Well-known Member
Joined
Jan 11, 2012
Messages
4,142
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
You can simply use TEXT to columns and use "-" as delimeter
 
Upvote 0

jmkelly1988

New Member
Joined
Dec 7, 2016
Messages
19
Yes, but is there a formula instead? The reason being I have a specific range that changes daily and would like it to automatically separate every time the values are changed.
 
Upvote 0

FDibbins

Well-known Member
Joined
Feb 16, 2013
Messages
6,723
With your data in A1...
B1=TRIM(MID(SUBSTITUTE($A1,"-",REPT(" ",LEN($A1))),LEN($A1)*(COLUMN()-2)+1,LEN($A1)))
copied down and across as needed
Adjust the ranges as needed
 
Upvote 0

jmkelly1988

New Member
Joined
Dec 7, 2016
Messages
19
Does the formula have to be adjacent to the data. If so, is there a way to make it where it doesn't have to be?
 
Upvote 0

FDibbins

Well-known Member
Joined
Feb 16, 2013
Messages
6,723
Does the formula have to be adjacent to the data. If so, is there a way to make it where it doesn't have to be?

No it does not have to be. Adjust my suggestion to this...
=TRIM(MID(SUBSTITUTE($A1,"-",REPT(" ",LEN($A1))),LEN($A1)*(COLUMNS($A$1:A1)-1)+1,LEN($A1)))
 
Upvote 0

Forum statistics

Threads
1,190,613
Messages
5,981,939
Members
439,744
Latest member
Lazerbeakk

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
Top