Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Leading zeroes get dropped when converted to text


Hello, I have a spreadsheet with a column of UPC numbers, some of which
need to have leading zeroes, so I set up a Custom number format with 11
zeroes (00000000000) so that they all display with the correct number of
digits. However, I eventually need to convert these columns to text for
a data import I’m doing, and when I do so, the leading zeroes
disappear.

I need a way to actually have these leading zeroes become part of the
value in the formula bar so I don’t lose them when I convert to text.
The only way I’ve been able to do it so far is to paste the values into
Notepad, format the column I want to paste into to text, and then paste
the data from Notepad back into Excel. I figure there’s GOT to be a way
to skip this step using Notepad, but I’ve no idea what it is. When I’m
dealing with thousands of UPCs, the Notepad solution is going to be
really cumbersome. Can anybody help me?


--
Jason Grunert
------------------------------------------------------------------------
Jason Grunert's Profile: http://www.excelforum.com/member.php...o&userid=37115
View this thread: http://www.excelforum.com/showthread...hreadid=568465

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Leading zeroes get dropped when converted to text


go to format cells and go to custom...

in the box type....

00000000000# (11 zeros)

job done

that way any number less than 11 numbers will have the relative leading
zeros


hth


--
mr_ben
------------------------------------------------------------------------
mr_ben's Profile: http://www.excelforum.com/member.php...o&userid=37106
View this thread: http://www.excelforum.com/showthread...hreadid=568465

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Leading zeroes get dropped when converted to text


Yeah, I've done that, but when I later try to convert that column to
text, the leading zeroes disappear. Thanks for the response though.


--
Jason Grunert
------------------------------------------------------------------------
Jason Grunert's Profile: http://www.excelforum.com/member.php...o&userid=37115
View this thread: http://www.excelforum.com/showthread...hreadid=568465

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Leading zeroes get dropped when converted to text


oh you didn't make that very clear.....hmmmm will have another stab
now...


--
mr_ben
------------------------------------------------------------------------
mr_ben's Profile: http://www.excelforum.com/member.php...o&userid=37106
View this thread: http://www.excelforum.com/showthread...hreadid=568465

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Leading zeroes get dropped when converted to text

If it's going to be a text column anyway,
why not replace all the leading number 0's with the letter O?

"mr_ben" wrote:


oh you didn't make that very clear.....hmmmm will have another stab
now...


--
mr_ben
------------------------------------------------------------------------
mr_ben's Profile: http://www.excelforum.com/member.php...o&userid=37106
View this thread: http://www.excelforum.com/showthread...hreadid=568465




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Leading zeroes get dropped when converted to text


I wish I could do that, but the import wouldn't work correctly if there
were letters there instead of numbers.


--
Jason Grunert
------------------------------------------------------------------------
Jason Grunert's Profile: http://www.excelforum.com/member.php...o&userid=37115
View this thread: http://www.excelforum.com/showthread...hreadid=568465

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default Leading zeroes get dropped when converted to text

Hi Jason. This might work for you. If your 11 digit number is in B2,
this formula will make an 11 character text value with leading zeros:

=LEFT("00000000000",11-LEN(B2)) & B2

Len

Jason Grunert wrote:
Hello, I have a spreadsheet with a column of UPC numbers, some of which
need to have leading zeroes, so I set up a Custom number format with 11
zeroes (00000000000) so that they all display with the correct number of
digits. However, I eventually need to convert these columns to text for
a data import I’m doing, and when I do so, the leading zeroes
disappear.

I need a way to actually have these leading zeroes become part of the
value in the formula bar so I don’t lose them when I convert to text.
The only way I’ve been able to do it so far is to paste the values into
Notepad, format the column I want to paste into to text, and then paste
the data from Notepad back into Excel. I figure there’s GOT to be a way
to skip this step using Notepad, but I’ve no idea what it is. When I’m
dealing with thousands of UPCs, the Notepad solution is going to be
really cumbersome. Can anybody help me?


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Leading zeroes get dropped when converted to text


Thanks, Len! That seems to do the trick!

(Though if anybody else has another solution involving formatting
instead of a formula, I'd be happy to hear them!)


--
Jason Grunert
------------------------------------------------------------------------
Jason Grunert's Profile: http://www.excelforum.com/member.php...o&userid=37115
View this thread: http://www.excelforum.com/showthread...hreadid=568465

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 252
Default Leading zeroes get dropped when converted to text

If you plan on converting numbers to text, you should either enter them with
a leading apostrophe, or format the cell to text before entering the numbers
in.

If you want to change an entire column of numbers to text with leading zeros
use this procedure.
1. In a helper column enter this formula and copy it down the entire
selection
=TEXT(A1,"00000000000")
2. Copy and paste special. Select "values"
3. Format the column as text.
4. Delete the helper column.



"Jason Grunert" wrote:


Hello, I have a spreadsheet with a column of UPC numbers, some of which
need to have leading zeroes, so I set up a Custom number format with 11
zeroes (00000000000) so that they all display with the correct number of
digits. However, I eventually need to convert these columns to text for
a data import Im doing, and when I do so, the leading zeroes
disappear.

I need a way to actually have these leading zeroes become part of the
value in the formula bar so I dont lose them when I convert to text.
The only way Ive been able to do it so far is to paste the values into
Notepad, format the column I want to paste into to text, and then paste
the data from Notepad back into Excel. I figure theres GOT to be a way
to skip this step using Notepad, but Ive no idea what it is. When Im
dealing with thousands of UPCs, the Notepad solution is going to be
really cumbersome. Can anybody help me?


--
Jason Grunert
------------------------------------------------------------------------
Jason Grunert's Profile: http://www.excelforum.com/member.php...o&userid=37115
View this thread: http://www.excelforum.com/showthread...hreadid=568465


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing leading decimals for text list Casey Excel Discussion (Misc queries) 3 September 28th 05 07:16 PM
Adding Leading Zeros to Text Jenn Excel Discussion (Misc queries) 4 January 12th 05 06:51 PM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM
CSV leading zeroes Tim_nol Excel Discussion (Misc queries) 2 December 28th 04 08:19 PM
numbers and text in Excel to read as text keeping the leading zer. Ralph Excel Discussion (Misc queries) 2 December 10th 04 07:05 PM


All times are GMT +1. The time now is 02:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"