ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Multiple formats in one cell (https://www.excelbanter.com/excel-worksheet-functions/446570-multiple-formats-one-cell.html)

MikeTi

Multiple formats in one cell
 
Hi,
I am trying to figure out how to have multiple phone number formats in one cell. For example;
I enter 9 digits into cell A1 for a U.S. phone number or 10 digits for a European phone number. I would like cell A1 to format the cell as +1 (123) 456-7891 for 9 digits and + 12 34 567 8910 for 10 digits. Is this possible to do without creating multiple cells? Your help is greatly appreciated.

Ron Rosenfeld[_2_]

Multiple formats in one cell
 
On Sun, 15 Jul 2012 14:43:57 +0000, MikeTi wrote:


Hi,
I am trying to figure out how to have multiple phone number formats in
one cell. For example;
I enter 9 digits into cell A1 for a U.S. phone number or 10 digits for a
European phone number. I would like cell A1 to format the cell as +1
(123) 456-7891 for 9 digits and + 12 34 567 8910 for 10 digits. Is this
possible to do without creating multiple cells? Your help is greatly
appreciated.


1. Note that US numbers have ten digits, and your European number example has 11 digits, although others have more.
2. So long as the first digit is not a zero, you can use the following custom format to differentially format numbers with 10 digits or less, vs those with more than 10 digits:

Format/Cells/Number/Custom Type: [<=9999999999]"+1 ("000) 000-0000;[9999999999]+ 00 00 000 0000



All times are GMT +1. The time now is 10:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com