A 0 in front

seahawk56

New Member
Joined
Jun 23, 2008
Messages
30
Is there a way to format a cell so that in a string of number if a 0 is in front it stays there. For example I will type in 007486 but I can only get it to show up as 7486.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Thanks I tried formatting it to text before but I was not reentering the number in. So no 0's were still in front, but when I did reenter the number it worked great.
Thanks again
 
Upvote 0
Upvote 0
Hi and welcome to the board!!!
My good friend Smitty gave you the practicle answer. You can, however, use Custom Formatting. Format>Cells>Number Tab. Choose Custom for category and for type enter as many zeros as you want. (Ex 000000). This will display the number with leading zeros, and you don't have to type them in. Excel will figure it out. The advandage is the cell still contains a number for calculation purposes. With my above format, entering 7486 will display as 007486

lenze
 
Upvote 0
TEXT("your desired number", "0000000") also works.

For instance, if I wanted a 5 digit number, that had 2 leading zeros, and I wanted the zeros to stay, it would be as such:

=text(123, "00000") = 00123
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,749
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top