Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
TechGuyatwork
 
Posts: n/a
Default Did not see any reply from yesterday. Need data formatting help

Ok I have data in excel that looks like this:

2345
23667867
12345678
8564
3557
The data needs to be formatted to look like this
00002345
23667867
12345678
00008564
00003557
How do I add the zero to eacfh of the fields?
Does this entail scripting of some sort?
Please reply!!! ASAP!!!
  #2   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi TechGuyatwork

Format the cells like this

Select them
Ctrl-1
Custom, use 00000000

--
Regards Ron de Bruin
http://www.rondebruin.nl


"TechGuyatwork" wrote in message
...
Ok I have data in excel that looks like this:

2345
23667867
12345678
8564
3557
The data needs to be formatted to look like this
00002345
23667867
12345678
00008564
00003557
How do I add the zero to eacfh of the fields?
Does this entail scripting of some sort?
Please reply!!! ASAP!!!



  #3   Report Post  
Ron Coderre
 
Posts: n/a
Default

Try this:

FormatCellsNumber
Category: Custon
Type: 00000000
Click [OK]

Note: that won't actuall prepend zeros to the the numbers. It will just
display zeros where needed.

Does that help?
--
Regards,
Ron
  #4   Report Post  
Alex
 
Posts: n/a
Default

Hello

Here is a quick fix with a caveat...

Suppose data start in cell A1 and goes down column 1...type in cell B1...

=IF(LEN(A1)<8,"0000"&A1,A1)

And then drag this formula down.

Caveats...

(1)In your example I assume you either have data of 4 digits or 8 digits in
length.

In the formula, the first part assesses whether the data is less then 8
digits. If so it adds the 0000, otherwise the data remains as it is.

(2) By adding "0000" you are adding a string to the data and so the values
produced are no longer of number format. If you try to type 00001234 in Excel
then you just get 1234 as a number format. To get around this I have made the
data into a string format. You will notice this as those values will be
aligned leff in the cell but others that have not had 0000 added will be
aligned right. The result of this is that it may affect any calculations you
may want to do using the data. Hence this is a quick and dirty fix...for
aesthetics only...

Alex

"TechGuyatwork" wrote:

Ok I have data in excel that looks like this:

2345
23667867
12345678
8564
3557
The data needs to be formatted to look like this
00002345
23667867
12345678
00008564
00003557
How do I add the zero to eacfh of the fields?
Does this entail scripting of some sort?
Please reply!!! ASAP!!!

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
Macro to search for and display data in another worksheet Mark H Excel Worksheet Functions 0 June 14th 05 12:40 PM
Import Data Keeps asking for Password Dominator Excel Discussion (Misc queries) 0 June 5th 05 11:25 PM
Pull Current Month's Data Out of List - Repost Karl Burrows Excel Discussion (Misc queries) 4 May 3rd 05 01:06 AM
Line Graph Data Recognition Nat Charts and Charting in Excel 2 April 30th 05 02:07 PM
Running Data Table using an input that triggers DDE linked data [email protected] Excel Discussion (Misc queries) 1 December 16th 04 11:56 AM


All times are GMT +1. The time now is 11:24 AM.

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"