We help IT Professionals succeed at work.

populate excel with 0, after existing data

smcelroy
smcelroy asked
on
165 Views
Last Modified: 2012-05-11
Hello, have a list of international dialing code rates and trying to get them to all be 9 digits in length. Below is an example and just looking to get the numbers in column A to go from "54" to "540000000" or "5411" to 541100000", so all values have 9 digits. We have an issue with our DMS250 table and better if all values are the same.

I have tried using Format Cells, select Custom and put nice "0"s, the that populates before

000000054      ARGENTINE REPUBLIC

Thanks,
Shawn

Column A and column B
54      ARGENTINE REPUBLIC
541      ARGENTINE REPUBLIC
549      ARGENTINE REPUBLIC
5411      ARGENTINE REPUBLIC
54114      ARGENTINE REPUBLIC
54221      ARGENTINE REPUBLIC
54223      ARGENTINE REPUBLIC
54230      ARGENTINE REPUBLIC
54232      ARGENTINE REPUBLIC
54261      ARGENTINE REPUBLIC
54291      ARGENTINE REPUBLIC
54299      ARGENTINE REPUBLIC
54341      ARGENTINE REPUBLIC
54342      ARGENTINE REPUBLIC
54348      ARGENTINE REPUBLIC
54351      ARGENTINE REPUBLIC
54353      ARGENTINE REPUBLIC
54358      ARGENTINE REPUBLIC
54381      ARGENTINE REPUBLIC
54387      ARGENTINE REPUBLIC
54911      ARGENTINE REPUBLIC
542652      ARGENTINE REPUBLIC
5422141      ARGENTINE REPUBLIC
5422142      ARGENTINE REPUBLIC
5422144      ARGENTINE REPUBLIC
5422146      ARGENTINE REPUBLIC
5422147      ARGENTINE REPUBLIC
5422148      ARGENTINE REPUBLIC
Comment
Watch Question

This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Engineer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Commented:
You can use a formula like this to add the zeros:

=A1&REPT("0",9-LEN(A1))

Please tale a look at the attached example.

jppinto
Add-Zeros-Right.xlsx
Saqib HusainEngineer
CERTIFIED EXPERT

Commented:
if the number and text are in the same cell then you might like to use

=SUBSTITUTE(A1,LEFT(A1,FIND(" ",A1)-1),LEFT(LEFT(A1,FIND(" ",A1)-1)&"000000000",9))

Author

Commented:
Thanks everyone, decided to use the "=left(A1&"000000000",9)" as that seemed pretty straight forward.

Author

Commented:
but both the =A1&REPT("0",9-LEN(A1)) and =left(A1&"000000000",9) did work

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.