Fill a 15 Characters Data with Zeros

I

ileanardz

I am getting nuts with this....

I have an amount in A1: 108.203

And I need to fill A2 that must be 15 characters with the value of A1
and the remain characters before the first number (1) must be fill
with Zeros.

E.I.:
The result must be:
A2= 00000000108.203

Is there a way to do it?
Thanks in advance for your help.
 
D

Dave Peterson

Maybe...
=text(a1,rept("0",11)&".000")

Is the number of decimal places always 3?
 
I

ileanardz

Yes, it is part of the "must" even A1 could be .01
A2 must display .010

Thanks your help
 
I

ileanardz

Thank you very much!!!!!
This really help me =)

This was the best for the .000
;)

=text(a1,rept("0",11)&".000")

Kind regards!!
 
M

Matt

A variation to Dave's formula:

=REPT(0,15-LEN(A1))&A1

This analyzes the length of the value in cell A1 and adds the appropriate
number of zeros to get to a total length of 15. This allows any number of
decimal places.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top