Forum Discussion
Andrew Meldrum
Aug 16, 2018Copper Contributor
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 ChanIron 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.
- Andrew MeldrumCopper Contributor
Thanks Man, the first letter could be any letter ....
- SergeiBaklanDiamond Contributor
Yes, you can't format the text such way
- Andrew MeldrumCopper Contributor
I am really surprised it is a NO.
- SergeiBaklanDiamond Contributor
You may use VBA to transform the text and return result into the same cell
- Andrew MeldrumCopper 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.