Adding a 0 to numbers lacking a digit

kd81

New Member
Joined
Jul 18, 2011
Messages
25
Hello,

I have a column with numbers that contain 4 digits and numbers that contain 3 digits.

I would like to a add a "0" add the end of the numbers with 3 digits and keep the numbers with 4 digits as they are.

Example: if in the column I have : 456, 9873, 939, 5434, 654

In the new column I would have: 4560, 9873, 9390,5434,6540

Thank you! :)
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
You can maybe add a column where you number will be added to a 0.

For example if your three digits number is in cell A1, in cell A2 you can input the formula : =A1&0

is it what you want ?
 
Upvote 0
Hello,

I have a column with numbers that contain 4 digits and numbers that contain 3 digits.

I would like to a add a "0" add the end of the numbers with 3 digits and keep the numbers with 4 digits as they are.

Example: if in the column I have : 456, 9873, 939, 5434, 654

In the new column I would have: 4560, 9873, 9390,5434,6540

Thank you! :)

Try this, where A1 is the start of the column with 456:

Code:
=IF(LEN(A1)=3,CONCATENATE(A1,0),A1)
 
Upvote 0
Hello,

I have a column with numbers that contain 4 digits and numbers that contain 3 digits.

I would like to a add a "0" add the end of the numbers with 3 digits and keep the numbers with 4 digits as they are.

Example: if in the column I have : 456, 9873, 939, 5434, 654

In the new column I would have: 4560, 9873, 9390,5434,6540

Thank you! :)
Assuming your data is in the range A2:A10.

Enter this formula in B2 and copy down to B10:

=IF(LEN(A2)=3,A2*10,A2)
 
Upvote 0
try this way
1)Select your range
2)Right Click --> Format Cells -- Custom .
3) copy this code

[>=1000]#;[<1000]0"0"

but i think you want to add the zero to left not to write
make sure from this point please
 
Upvote 0
Or try this:

<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: right;;">456</td><td style="text-align: right;;">9873</td><td style="text-align: right;;">939</td><td style="text-align: right;;">5434</td><td style="text-align: right;;">654</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;;">4560</td><td style="text-align: right;;">9873</td><td style="text-align: right;;">9390</td><td style="text-align: right;;">5434</td><td style="text-align: right;;">6540</td></tr></tbody></table><p style="width:3em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Plan1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">A2</th><td style="text-align:left">=1*LEFT(<font color="Blue">A1&"0",4</font>)</td></tr></tbody></table></td></tr></table><br />
Markmzz
 
Upvote 0
Assuming your data is in the range A2:A10.

Enter this formula in B2 and copy down to B10:

=IF(LEN(A2)=3,A2*10,A2)

I never thought of just multiplying by 10, that simplifies it though. Gotta love Excel, so many different ways to get the exact same result.
 
Upvote 0
I never thought of just multiplying by 10, that simplifies it though. Gotta love Excel, so many different ways to get the exact same result.
Yeah, just look at this thread. 8 replies and growing!
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,253
Members
452,900
Latest member
LisaGo

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