Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 272
Default how do you create a new special cell format in Excel?

I have a list of cells that should contain 9 digits. I need to force a zero
as the first character if the cell only contains 8 digits. (Not all of them
import as 9 digits). I also need to force a dash after the second digit. I
need to have it display as 12-3456789 or as 01-2345678.
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default how do you create a new special cell format in Excel?

right click the column, format cells, custom

"Lori" wrote:

I have a list of cells that should contain 9 digits. I need to force a zero
as the first character if the cell only contains 8 digits. (Not all of them
import as 9 digits). I also need to force a dash after the second digit. I
need to have it display as 12-3456789 or as 01-2345678.
Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 353
Default how do you create a new special cell format in Excel?

Excel 2003 - Format, cells, number tab, custom category
and enter 00"-"0000000

Excel 2007 - home tab, cells group, format, format cells, number tab, custom
category and enter 00"-"0000000

The dash will always appear in the eigth position from the right and any
numbers less than nine digits will display leading zeros.

"Lori" wrote:

I have a list of cells that should contain 9 digits. I need to force a zero
as the first character if the cell only contains 8 digits. (Not all of them
import as 9 digits). I also need to force a dash after the second digit. I
need to have it display as 12-3456789 or as 01-2345678.
Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 168
Default how do you create a new special cell format in Excel?

Assume your data is in A1:A100

In column B, starting in B1, enter this formula

=IF(LEN(A1)<9,REPT(0,9-
LEN(A1))&LEFT(A1,1)&"-"&MID(A1,2,7),LEFT(A1,2)&"-"&MID(A1,2,7))


Fill down as needed, then paste values to hard-code the result


HTH,
JP


On Nov 14, 12:37 pm, Lori wrote:
I have a list of cells that should contain 9 digits. I need to force a zero
as the first character if the cell only contains 8 digits. (Not all of them
import as 9 digits). I also need to force a dash after the second digit. I
need to have it display as 12-3456789 or as 01-2345678.
Thanks!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2002; cell format confuses Custom and Special TeeArr Excel Discussion (Misc queries) 2 October 11th 07 01:56 PM
Special Cell Format Spymann Excel Discussion (Misc queries) 9 February 3rd 07 02:49 PM
Excel needs a special cell format for MAC addresses Don Excel Discussion (Misc queries) 0 July 20th 06 02:16 PM
Special format for feet - inches in a cell Bothell John Excel Discussion (Misc queries) 1 September 8th 05 12:28 AM
excel data label format special number characters todd Excel Discussion (Misc queries) 0 May 4th 05 01:30 PM


All times are GMT +1. The time now is 12:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"