Creating an FTP file. need cell to be 18 characters long with leading zeros.

Declamatory

Active Member
Joined
Nov 6, 2014
Messages
319
Hi Folks,

I am creating a file for import to a client's system. One of the values is an amount. The cell has to be 18 characters long with no decimal points (the pence or cents will be the last two characters). If the amount in Sheet1 cell A1 was £19.99 then the cell B2 in sheet 2 would look like 000000000000001999.

How can I get the leading zeros in front of the amount bearing in mind that the amount could be anything from £0.00 to £10,000,000,000.00?

Does anyone have any ideas?

Thanks,
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi, if you're looking for a formula method to return the new formatted value then here is one option:


Excel 2013/2016
AB
11000000000000000100
21.5000000000000000150
319.99000000000000001999
410,000,000,000.00000001000000000000
Sheet1
Cell Formulas
RangeFormula
B1=SUBSTITUTE(TEXT(A1,"0000000000000000.00"),".","")
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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