Forum Discussion

Andrew Meldrum's avatar
Andrew Meldrum
Copper Contributor
Aug 16, 2018

Formatting in Excel

I am trying to format a cell so the output looks like C23-569-789 when the following is entered into the cell c23569789.

 

I can't seem to get it to work because of the leading Alpha.

 

Help.

8 Replies

  • Man Fai Chan's avatar
    Man Fai Chan
    Iron Contributor

    If you are sure that the first letter is "C", you may consider the number format "C00-000-000" (without quotation) and just input number part. 

     

      • SergeiBaklan's avatar
        SergeiBaklan
        Diamond Contributor

        You may use VBA to transform the text and return result into the same cell

    • Andrew Meldrum's avatar
      Andrew Meldrum
      Copper Contributor

      I got close with =UPPER(LEFT(E1,3)&"-"&MID(E1,4,3)&"-"&RIGHT(E1,3)) but it is a function and requires two columns ... I only want one.

       

Resources