# Thread: Creating a code from combining numbers from several cells

1. ## Creating a code from combining numbers from several cells

Register for a FREE account, and/
or Log in to avoid these ads!

I have a spreadsheet that contains, in part, 5 columns of numbers that I want to combine to create one overall field that can be used as a key field. The number of digits in each column is different but I want a fixed-length digit as the output. There are leading zeros (for example "001) in some fields and others contain all zeros ("00000") but every digit is important as part of the code. How can I combine these fields? I am obviously not an experienced programmer. I have tried the concatenate formula but I lose the placeholder zeros. Thanks for any help you can offer.

2. Can you give some examples of how the sheet looks, and the outcome you desire?

3. Originally Posted by NBVC
Can you give some examples of how the sheet looks, and the outcome you desire?
I have columns that contain a street code, address code, distance, corner street code and maintenance district. One line has the numbers:

100 00000 0015 053 3

I want to get all of these codes into one cell that would have the result of: 100000000150533

What I need to do is combine the cells but keep the number of digits in each cell, for instance not have the "00000" value treated as "0".

4. I assume then the originals are just formatted to appear as 3, 4 or 5 digits numbers?

Then you will need the TEXT function...

e.g.

=TEXT(A1,"000")&TEXT(B1,"00000")&TEXT(C1,"000")&TEXT(D1,"000")&E1

The number of 0's represents the number of digits for each cell....

5. Thanks, I will try it! I appreciate the help.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•