Text to Columns - Can't change destination fields to text

DavidBroadus

New Member
Joined
Jul 9, 2014
Messages
7
When separating telephone numbers to the appropriate format, I change the destination cells in the spreadsheet to 'text', and also change the destination fields to 'text' in the 'text to columns' wizard. The separated numbers, however, still drop leading zeros. How can I retain the leading zeros in the destination columns?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi and welcome to the board. I assume the 1st column has the original number and B1 has the number with the missing zeros after splitting to columns

Then let say you insert a new blank column C and could put in C1 something like this

=RIGHT(TEXT(B1,"0000"),3)

Now the more zeros you put in fill the beginning of the cell with zeros in this case 3 zeros before the number starts. Then I assumed that field always has only 3 digits hence the 3

You will need to play around with the number of zeros and the 3 to suit your needs

Cheers
 
Upvote 0
If you specify Text as the column data format then you shouldn't lose leading zeroes, and you shouldn't need to format the destination cells to Text.

Is the data delimited or fixed width?

If it's the former what are you using for the delimiter?

Can you post small set of sample data?
 
Upvote 0
If you specify Text as the column data format then you shouldn't lose leading zeroes, and you shouldn't need to format the destination cells to Text.

Is the data delimited or fixed width?

If it's the former what are you using for the delimiter?

Can you post small set of sample data?

Hi Norie,

ORIG
100200
100300
100400
100500
100600
SPLIT
10200
10300
10400
10500
10600
All columns are text. Split was made with 'fixed' criteria: 2 digits/4 digits. As you can see in column B, 0 is missing.

(Sorry if I'm not responding in the correct manner - my first time on here)

Dave

<tbody>
</tbody>
 
Upvote 0
Hi Ace,

Thanks very much for that! Your formula takes care of the problem. Still curious as to why it happens in the first place, but at least I don't have to change them all manually.

Regards,
Dave
 
Upvote 0
Dave

When I carry out Data>Text to columns... and specify Text for the 2nd column (or both columns) the leading zero isn't lost.

I even get the warning from Excel that I have numbers stored as text.
 
Upvote 0
Hhmmm...well, we all know how annoying it is when a problem is specific only to oneself, but I'll live with it for now, using Ace's workaround. Thanks, Norie!
 
Upvote 0
Hi,Dave
To separate the left number
This formula can be used
=LEFT(A1;FIND(REPT("0";2);A1))*1
To separate the number right
This formula can be used
=RIGHT(A1;LEN(A1)-FIND("0";A1)-1)*1
 
Upvote 0
It you want to use formulas use LEFT and RIGHT.

=LEFT(A1,2)

=RIGHT(A1,4)

If you don't know the no of digits at the end use MID.

=MID(A1,3, LEN(A1)
 
Upvote 0

Forum statistics

Threads
1,215,002
Messages
6,122,652
Members
449,092
Latest member
peppernaut

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