Joining formatted cells

T

tonywar

I need to join (concatenate) two cells that have been custom formatted.
Both cells contain numbers. The second cell is a number ranging fro
0001 to 2211. When joining the cells, Excel drops the leading zeroe
from the result which I need.

I have tried forcing the format on Cell2 to ####...text, etc...nothin
has worked thus far.

Example:

Cell1: 123456
Cell2: 0034

Needed result: 123456-0034

Actual result: 123456-34

Anyone help me keep my leading zeroes in the result?? :
 
J

JE McGimpsey

One way:

=Cell1 & "-" & TEXT(Cell2,"0000")

As you've found out, only values are taken from referenced cells, not
formatting, requiring formatting in the referencing cell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top