Excel – Insert spaces in excel number sequences

conditional formattingmicrosoft excel

I am trying to format cells so when I type in phone numbers it automatically formats them as follows: –

Landline Nos e.g. 02012345678 to appear as 020 1234 5678

Mobile Nos e.g. 07123456789 to appear as 07123 456 789

I was trying to use conditional formatting for text strings beginning with "020" or "07" but when I type the custom number format in as ### #### #### it wouldn't insert the spaces. I'm probably doing something really stupid so any help would be greatly appreciated.

Thanks.

Best Answer

Go to the cell.

Press CTRL+1 to open the Format Cell.

Go to the Number Tab

Under "Category", select "Custom"

Where it says "Type", enter 0## #### ####

This should ensure that you get your leading zero, and that the spaces are added.

Excel also has a format under the "Special" category just for Phone Numbers. If you click that, then click "Custom" it will insert the Phone format which you can then edit as you see fit.