Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Inserting a hyphen after the 3rd character

Hi All,

I am looking for a way to insert a hyphen (-) in a cell after the
third character. For example,

123456789 turns into 123-456789. Any ideas? Thanks in advance!!! Jen
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Inserting a hyphen after the 3rd character

One way:

=LEFT(A1,3)&"-"&RIGHT(A1,LEN(A1)-3))

Hope this helps.

Pete

On Oct 29, 6:42*pm, wrote:
Hi All,

I am looking for a way to insert a hyphen (-) in a cell after the
third character. For example,

123456789 turns into 123-456789. Any ideas? Thanks in advance!!! *Jen


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Inserting a hyphen after the 3rd character

Pete_UK wrote...
One way:

=LEFT(A1,3)&"-"&RIGHT(A1,LEN(A1)-3))

....

Shorter, simpler, more efficient to use

=REPLACE(A1,3,0,"-")
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default Inserting a hyphen after the 3rd character

Harlan,

I think that you may have meant:

=REPLACE(A1,4,0,"-")

to insert the hyphen after the third character not the second.

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Harlan Grove" wrote in message
...
Pete_UK wrote...
One way:

=LEFT(A1,3)&"-"&RIGHT(A1,LEN(A1)-3))

...

Shorter, simpler, more efficient to use

=REPLACE(A1,3,0,"-")



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
Trying to use IF statement with hyphen AmytDev Excel Worksheet Functions 3 May 15th 07 04:50 PM
Optional hyphen? Eric Excel Discussion (Misc queries) 4 October 19th 06 01:31 AM
inserting special character in a cell as a macro johnnyboy New Users to Excel 3 September 11th 06 09:05 PM
...I want to display a hyphen instead of zero... Dr. Darrell Excel Worksheet Functions 2 August 1st 05 01:18 PM
sort cells with hyphen #####-###-#### infurtaris Excel Discussion (Misc queries) 0 January 1st 05 05:15 PM


All times are GMT +1. The time now is 11:19 PM.

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"