Share via

Using the Concatenate function with both Alpha Characters and Leading Zeros

Anonymous
2017-12-19T22:32:12+00:00

I am trying to concatenate an alpha character with a numeric value that has leading zeros.  For example: 

Alpha Char  = W   

Numeric Value = 01209 (Cell = A2) 

When I use the =Concatenate("W", A2) the result that I get is W1209.  Then I tried to take the value W1209 (B2) and use the text function =Text(B2,000000) to get the result of W01209.  Doesn't work.  Any suggestions?  

The end result that I want is W01209.  How can you accomplish this in Excel? 

Thank you in advance.

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2017-12-20T09:05:43+00:00

As the leading zero is not appearing when CONCATENATE is used I belive we can assume A2 contains a number and a custom number format of 00000 is applied.

Therefore you need to apply that same custom number format within the concatenation.

=CONCATENATE("W",TEXT(A2,"00000"))

Was this answer helpful?

5 people found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2017-12-20T15:31:56+00:00

    Hi Jason,

    Thanks for the help.  This helped and continued research found an additional solition.  You can also combine the LEN and REPLACEMENT functions

    example:  working with the following two values:

    Q2 = W1290

    Q3 = W12560

    by using the the formula:

    =IF(LEN(Q2)=5,REPLACE(Q2,2,0,0),Q2)

    Q2 = W01290

    Q3 = W12560

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2017-12-19T23:03:34+00:00

    What is actually entered in cell A2 when you look at it in the formula bar?

    What is the cell format of cell A2?

    If the value in the formula bar is 1209, then CONCATENATE("W", A2) will result in W1209.

    However, if the value in the formula bar when you are in cell A2 is 01209, then CONCATENATE("W", A2) will result in W01209.

    If it is 1209, change the cell format to Text, and then retype the value 01209 in the cell. The function should then produce the result you want.

    Was this answer helpful?

    0 comments No comments