text to columns number like 978-123-0000

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
Can I ask text to column to replace on the first - with column? in another words, can I ask text-2- columns to do this

978123-0000

<tbody>
</tbody>

instead of this

9781230000

<tbody>
</tbody>

Thank you.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
you can try PowerQuery
Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Split Column by Delimiter" = Table.SplitColumn(Source, "Column1", Splitter.SplitTextByEachDelimiter({"-"}, QuoteStyle.Csv, false), {"Column1.1", "Column1.2"})
in
    #"Split Column by Delimiter"[/SIZE]
Column1Column1.1Column1.2
978-123-0000978123-0000
 
Upvote 0
Hi,

A couple of formula options.

B1 formula copied across, OR
use B2 and C2 formulas:


Book1
ABC
1978-123-0000978123-0000
2978-123-0000978123-0000
Sheet329
Cell Formulas
RangeFormula
B1=TRIM(MID(SUBSTITUTE($A1,"-",REPT(" ",99),1),COLUMNS($B1:B1)*99-98,99))
B2=LEFT(A2,FIND("-",A2)-1)
C2=MID(A2,FIND("-",A2)+1,99)
 
Upvote 0
.. or if the data structure is uniform (1 example isn't much to go on) you can do it with Text to Columns (Fixed width)
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,165
Members
448,870
Latest member
max_pedreira

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