#1   Report Post  
Posted to microsoft.public.excel.misc
Rebecca
 
Posts: n/a
Default Add Zeros to Numbers

Greetings. I'm using EXCEL 2003, and I have a problem that I can't seem to
find the answer to. I have a column that has 15506 rows, and each row
contains a number, an underline, and a word. The rows look something like
this:

1_blah
2_blahblah
3_cat
4_dog
....
234_flower
235_flowing
....
15500_zebra
15501_zemo
etc.

I need to put four zeros in front of numbers 1-9, three from 10-99, etc., so
I can later sort on this column when I'm using the data in another program
(please don't ask why the data is like this; it just is!). Is there a way to
add these zeros automatically before the words but without having to do any
programing, something I am unable to do? I would deeply appreciate your help
in solving this problem.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Niek Otten
 
Posts: n/a
Default Add Zeros to Numbers

=REPT("0",6-FIND("_",A1))&A1
Copy down as far as needed.

--
Kind regards,

Niek Otten

"Rebecca" wrote in message
...
Greetings. I'm using EXCEL 2003, and I have a problem that I can't seem
to
find the answer to. I have a column that has 15506 rows, and each row
contains a number, an underline, and a word. The rows look something like
this:

1_blah
2_blahblah
3_cat
4_dog
...
234_flower
235_flowing
...
15500_zebra
15501_zemo
etc.

I need to put four zeros in front of numbers 1-9, three from 10-99, etc.,
so
I can later sort on this column when I'm using the data in another program
(please don't ask why the data is like this; it just is!). Is there a way
to
add these zeros automatically before the words but without having to do
any
programing, something I am unable to do? I would deeply appreciate your
help
in solving this problem.



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
converting numbers to text gls858 New Users to Excel 2 October 18th 05 10:56 PM
Checking Winning Numbers in the Lottery. Ann Excel Discussion (Misc queries) 4 May 18th 05 10:55 AM
Sorting alphanumeric numbers maurice.centner Excel Discussion (Misc queries) 2 May 6th 05 02:00 AM
csv file drops zeros at beginning of a set of Numbers Lisa Excel Discussion (Misc queries) 2 January 8th 05 08:53 PM
Sorting when some numbers have a text suffix confused on the tundra Excel Discussion (Misc queries) 5 December 18th 04 10:19 PM


All times are GMT +1. The time now is 04:10 AM.

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"