Data query and decimals places "Need 2 places"

RBGDaboys

New Member
Joined
Jul 18, 2007
Messages
33
I have a data query that pulls in some costing. It isn't always in the same format.
Example
12.87
12.4
150

I then use a function to make it 10 places:
=RIGHT("000000000000000000"&E5,10)
0000012.87
00000012.4
0000000150

The ploblem is a need the costing to ALWAYS have 2 deimal places even when my query returns 1 or 0 places. If less than 2 places I want to add zeros PLUS remove the decimal point.

Example
12.87
12.4
150

Would equal
0000001287
0000001240
0000015000

I then need to copy these numbers to a text file so plain cell formating doesn't work.

I search around here and found some help but no working solution.

Thank you for your time.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

big_mac

Board Regular
Joined
Jul 21, 2006
Messages
167
have you tried =text(E5,"0000000000.00") this should make it text and 12 digits. adjust your 0's to how ever you need them.
 
Upvote 0

RBGDaboys

New Member
Joined
Jul 18, 2007
Messages
33
That worked, thank you

BUT

I now need to remove that decimal point. I can with a macro but would be great to remove it in that fomular you gave me if it can be done.
 
Upvote 0

Forum statistics

Threads
1,191,030
Messages
5,984,232
Members
439,879
Latest member
KingGoulash

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