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

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
Welcome to the Board!

You'll need to format it as Text.

HTH,
 

seahawk56

New Member
Joined
Jun 23, 2008
Messages
30
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
 

xenou

MrExcel MVP
Joined
Mar 2, 2007
Messages
16,836
Office Version
  1. 2019
Platform
  1. Windows

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
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
 

dyaron

Active Member
Joined
Nov 26, 2007
Messages
291
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,669
Messages
5,838,684
Members
430,563
Latest member
Raeyven

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
Top