Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Format cell in Excel to accept zeros in front

Posted on 2010-08-18
8
461 Views
Last Modified: 2012-05-10
Excel 2010.  How can I format cells in Excel so it accepts zeros(000) in front of the numbers.  I tried General, Numbers, etc - nothing helps.

Please advice.
0
Comment
Question by:Tiras25
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 21

Expert Comment

by:Hendrik Wiese
ID: 33469389
Try a custom value of 0000 then it will show leading zeros
0
 
LVL 4

Expert Comment

by:Scanman999
ID: 33469390
Just used the CUSTOM option in the Cell Format dialog and put 000000 to format any numbers to 6 digits in this case
0
 
LVL 21

Expert Comment

by:Hendrik Wiese
ID: 33469412
sorry so you would go Format Cells > click on Custom and in the Type field where the default value is General just type in 0000 and click ok.

Now when you enter 5 in the field it will display as 0005
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 4

Assisted Solution

by:abitoun
abitoun earned 50 total points
ID: 33469463
that is the best option for a lot of fields but it actually does not add the zeroes, it just mask the zeroes. in other words it is only a visual effect. if you want to add the zeroes for rea (for example if you are saving a text file and the id's need zeroes) you can add an apostrophe (') before the first zero and excel will treat it as such, unfortunately if you save it as csv and reopen it excel will truncate the zeroes again. if you have a huge list you can use the followingformula to achieve your goal:

="'"&repeat(0,10-len(a2))&a2
in the above formula a2 has the number without zeroes, 10 is the total length i want for the field, then i add a2 and gives me a perfect field of 10 charachters with leading zeroes.
0
 
LVL 17

Author Comment

by:Tiras25
ID: 33469475
That still doesn't work for me.  I have a number in the cell [1788348].  I need to keep this number with 00 in front [001788348].  I put zeros in, and when go next cell it switches back to 'no-zeroes' format.  

Custom still doesn't help....
0
 
LVL 4

Expert Comment

by:abitoun
ID: 33469505
when you go to custom you put:
00####### so custom knows to add two zeeroes in front of the number
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 450 total points
ID: 33469522
Change the numberformat to Text; that will force Excel to treat entries into that range as text, even if they "look" like numbers.
0
 
LVL 17

Author Comment

by:Tiras25
ID: 33469556
OK apostrophe and Text formatting works.  

Thank you!
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to line 23 53
Turn date into age 17 32
Create an Excel User-form to Display Filter Results - Modify Macro 10 25
excel conditional formating 4 15
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question