Formatting a Number Field

abardel

New Member
Joined
Apr 22, 2005
Messages
22
I am using Excel 97 and I need to do the following:


I have a column of values that look like this:

12.23
15.55
14.15 etc

I need to format each of them to look like this:

000000001223
000000001555
000000001415

Any help would be greatly appreciated. thanks
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Will this do it for you:

<font face=tahoma><SPAN style="color:#00007F">Sub</SPAN> Macro1()
    <SPAN style="color:#00007F">Dim</SPAN> c <SPAN style="color:#00007F">As</SPAN> Range
        <SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> c <SPAN style="color:#00007F">In</SPAN> Range([A1], [A65536].End(xlUp))
            c = c * 100
            c.NumberFormat = "00000000####"
        <SPAN style="color:#00007F">Next</SPAN> c
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

Hope that helps,

Smitty
 
Upvote 0
I've had a try with on my computer and I can't see an easy way of formatting it.

I've come up with a formula though that you could use if you created an other column.

Assuming your first value is in A1 the formula would be..
=TEXT(A1,"00000000##"&MID(A1,(FIND(".",A1,1)+1),2))

If you want it as a number (i.e. 1223 but with 00000000) change it to
=VALUE(TEXT(A1,"00000000##"&MID(A1,(FIND(".",A1,1)+1),2)))
But you would need to right-click and format the cell as custom, and the type would be 00000000##.

Hope that helps! :)
 
Upvote 0
If you want it as a number (i.e. 1223 but with 00000000) change it to
=VALUE(TEXT(A1,"00000000##"&MID(A1,(FIND(".",A1,1)+1),2)))
But you would need to right-click and format the cell as custom, and the type would be 00000000##.

This one worked, kinda....

My value was 16.85 and it returned 0000000017 (looks like it rounded up)

I really need it to show 000000001685???
 
Upvote 0
abardel said:
NBVC said:
Try This

=TEXT(SUBSTITUTE(A1,".",""),"000000000000")



That returned 0.00

This is what I got:
Book1 (version 1).xls
EFGH
1612.23000000001223
Unit A


Are you sure your original data is in A1? In my example it is E16 and the formula references E16
 
Upvote 0
Are you sure your original data is in A1? In my example it is E16 and the formula references E16[/quote]

Thanks for the follow up, I'll try it again!
 
Upvote 0
Are you sure your original data is in A1? In my example it is E16 and the formula references E16[/quote]

Another question??? The ones that are 10.00, I need to show as 000000001000 (not as displayed below), and the one that is 12.12, I need to show as 000000001212 (not as below)

Any suggestions?

16.85 000000001685
0.00 000000000000
8.82 000000000882
8.82 000000000882
10.00 000000000010
10.00 000000000010
10.00 000000000010
10.96 000000001096
12.00 000000000012
12.12 000012115385
12.50 000000000125
13.25 000000001325
14.66 000000001466
15.68 000000001568
17.21 000000001721
20.72 000000002072
20.72 000000002072
20.72 000000002072
20.72 000000002072
 
Upvote 0

Forum statistics

Threads
1,207,093
Messages
6,076,545
Members
446,212
Latest member
KJAYPAL200

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