"text to columns" with numbers

alfordtp

Board Regular
Joined
Oct 3, 2008
Messages
54
I have cells that contain multiple values as a full string:

Apple - Banana - 000123

When I convert to three columns using the "text to columns" operation, the third column converts to a number and removes the leading zeros (cell value turns into 123 as a number). This is breaking my lookup function. Any ideas how to keep everything as text and exactly as it is shown?

TIA

Tim
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Tetra201

MrExcel MVP
Joined
Oct 14, 2016
Messages
3,643
In the Text-to-Columns Wizard, select the Text format for your third column.
 

jtakw

Well-known Member
Joined
Jun 29, 2014
Messages
6,007
Office Version
  1. 2016
Platform
  1. Windows
Hi,

Try this:

Text to Columns, Delimited, Next
Check "Other", Hyphen, Next
Select/Highlight 3rd column in preview pane (where the number is), Select "Text" upper left, Finish.

Edit, already answered, type too slow;)
 
Solution

alfordtp

Board Regular
Joined
Oct 3, 2008
Messages
54
Thank you for the full explanation. I didnt realize that you had to click each column and select text. I was clicking the text option, but apparently it was only for the first column.
 

jtakw

Well-known Member
Joined
Jun 29, 2014
Messages
6,007
Office Version
  1. 2016
Platform
  1. Windows
You're welcome, glad to help, thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,126
Messages
5,640,272
Members
417,132
Latest member
Srw123

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