Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jenn
 
Posts: n/a
Default Adding Leading Zeros to Text

In column A I have text like the following
1.2
01.34
03.4
2.1

What I need excel to do is look in Column A and any text that does not begin
with a zero character, add a zero to the beginning of the text string, else
leave it alone. So that my above example when done would look like:

01.2
01.34
03.4
02.1

Any quick fixes for this? I have a thousand rows so doing this by hand would
really stink!
Thanks in advance!


  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

How about adding a formula of 00.0#?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jenn" wrote in message
...
In column A I have text like the following
1.2
01.34
03.4
2.1

What I need excel to do is look in Column A and any text that does not

begin
with a zero character, add a zero to the beginning of the text string,

else
leave it alone. So that my above example when done would look like:

01.2
01.34
03.4
02.1

Any quick fixes for this? I have a thousand rows so doing this by hand

would
really stink!
Thanks in advance!




  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

sorry, meant custom format not formula.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jenn" wrote in message
...
In column A I have text like the following
1.2
01.34
03.4
2.1

What I need excel to do is look in Column A and any text that does not

begin
with a zero character, add a zero to the beginning of the text string,

else
leave it alone. So that my above example when done would look like:

01.2
01.34
03.4
02.1

Any quick fixes for this? I have a thousand rows so doing this by hand

would
really stink!
Thanks in advance!




  #4   Report Post  
Dave O
 
Posts: n/a
Default

This formula did it for me:
=TEXT(VALUE(A1),"00.00")

Working from the inside out, this formula converts your text to a value
to standardize each entry so it does not have a leading zero. Then the
formula converts it back to text in 00.00 format- this to accommodate
the 2 decimal places required as in the 01.34 example.

  #5   Report Post  
Jenn
 
Posts: n/a
Default

Thanks! Both worked like a charm!

"Dave O" wrote:

This formula did it for me:
=TEXT(VALUE(A1),"00.00")

Working from the inside out, this formula converts your text to a value
to standardize each entry so it does not have a leading zero. Then the
formula converts it back to text in 00.00 format- this to accommodate
the 2 decimal places required as in the 01.34 example.


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
Adding cells, using text as number Pgsmom Excel Discussion (Misc queries) 4 January 10th 05 07:21 PM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM
How do I display leading zeros so I can export a fixed in Excel? World Referee and accountant Excel Discussion (Misc queries) 2 January 3rd 05 04:18 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
Adding a text label to a line. Neil Charts and Charting in Excel 1 December 4th 04 08:41 PM


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

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

About Us

"It's about Microsoft Excel"