excel format text such as aa-aaa-aa

November 23, 2010 at 23:29:19
Specs: Windows XP
I have a cell containing aaaaaaa that i want to format to aa-aaa-aa

See More: excel format text such as aa-aaa-aa

Report •


#1
November 23, 2010 at 23:46:15
Highlight the cell or group of cells, right click, go to FORMAT CELLS, in NUMBERS tab click TEXT tab. Anyththing entered in cell/s, even nmbers, will be treated as text.

Report •

#2
November 24, 2010 at 07:42:30
As far as I know, you can not format TEXT with any type of wild card character, so to format your text string you will need a formula or macro.

Here is a formula that should give you what you want, provided your character string is always 7 characters long:

With your string aaaaaaa in cell A1, in cell B1 enter the formula:

=LEFT(A1,2)&"-"&MID(A1,3,3)&"-"&RIGHT(A1,2)

MIKE

http://www.skeptic.com/


Report •

#3
November 24, 2010 at 08:45:30
re: Highlight the cell or group of cells, right click, go to FORMAT CELLS, in NUMBERS tab click TEXT tab.

There is no TEXT tab in the Format Cells dialog box.

Even if there was, please explain how formatting the cells as text will accomplish the OP's goal of adding dashes between the letters in the string.

Posting Tip: Before posting Data or VBA Code, read this How-To.


Report •

Related Solutions


Ask Question