# How to keep "00" in front of a value

Hi,

This is the formula that I am using: = left(A1,5). For example, A1 = 00103 - AAA BBB CCC, B1 gives me 00103. However, when I hard code this value, two zeros disappear and I am left with 103 only. what should I do to keep "00" as well?

thanks,
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Older than dirtCommented:
Format the output cells as Text rather than General.
Microsoft Excel ExpertCommented:
Or put a apostrophe '  before the start of the text.  For example. '00103
Commented:
Or you can do:

=LEFT(TEXT(A1,"00000"),5)
Commented:
Sorry, the previous one should be:
=RIGHT(TEXT(A1,"00000"),5).

Something else could be bellow if you calculate on 2 cells:

=RIGHT(TEXT(A1,"00000"),3)-RIGHT(TEXT(A2,"00000"),3)
Commented:
Change this formula of urs to this..

=text(left(A1,5),"@")

Or

="'"&left(a1,5)

***Or and 2nd Solution..Edited Comment..

Post which if you do the paste special values you won't see your results getting changed..

Saurabh...

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Microsoft Excel ExpertCommented:
you could worksheet event, that for any hardcoding value it automatically preserves the 00

see the attached
Book1.xlsm
IT ManagerCommented:
or, set a Custom Format on the cells of 00000.  This has the advantage of letting you build number sequences, etc - 103,104,105, and so on.
Author Commented:
Thank you to all of you!
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.