PDA

View Full Version : Maintaining Leading Zeros


Amyunimus
Oct 2, 2007, 07:44 AM
In column A, I have the numbers 1-48, with leading zeros for the numbers under 10:


01
02
03...

47
48


In the second column, I have v3 or v2 randomly listed.

v2
v2
v3
v2
v3

etc

I want to make a new column that merges column A and B with an underscore:

01_v2
02_v2
03_v3

etc.

When I use " =A1&"_"&B1" I lose the leading zero, and end up with

1_v2
2_v2
3_v3

etc.

Is there anyway to maintain the leading zero across this formula? I tried changing the format of both the v2/v3 cells and the result cells to the same custom format I have for the numbers, but that doesn't work.

Thank you.
Emily

NeedKarma
Oct 2, 2007, 07:50 AM
What about setting the format to Text?

Amyunimus
Oct 2, 2007, 08:05 AM
I think that might work-- do you know if this will interfere with future LOOKUP functions? That is, the lookup function tends to be very picky about ascending order, and I wasn't sure if there would be problems converting some of my numbers to text.

ScottGem
Oct 2, 2007, 08:08 AM
yes you need to set to Text. Numeric values don't have leading zeros. And no, it wouldn't affect the lookups.