Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding hyphen to text in cell
I would like to add a hypen to the text that exists on the excel sheet. Is
there a formula for this? example of text on sheet without hypen: G212DA text with hypen: G-212DA |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding hyphen to text in cell
Assuming you always want the hyphen after the first character,
=LEFT(A1,1)&"-"&RIGHT(A1,(LEN(A1)-1)) Regards, Alan. "Penny" wrote in message ... I would like to add a hypen to the text that exists on the excel sheet. Is there a formula for this? example of text on sheet without hypen: G212DA text with hypen: G-212DA |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding hyphen to text in cell
Try
=LEFT(A1,1)&"-"&MID(A1,2,999) Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Tue, 24 Mar 2009 08:12:01 -0700, Penny wrote: I would like to add a hypen to the text that exists on the excel sheet. Is there a formula for this? example of text on sheet without hypen: G212DA text with hypen: G-212DA |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding hyphen to text in cell
My mistake.. not all need it after the first character. I also need after
second: example: GA02004 Example: GA-02004 "Alan" wrote: Assuming you always want the hyphen after the first character, =LEFT(A1,1)&"-"&RIGHT(A1,(LEN(A1)-1)) Regards, Alan. "Penny" wrote in message ... I would like to add a hypen to the text that exists on the excel sheet. Is there a formula for this? example of text on sheet without hypen: G212DA text with hypen: G-212DA |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding hyphen to text in cell
Change the formula to,
=LEFT(A1,2)&"-"&RIGHT(A1,(LEN(A1)-2)) You could enter where you want the hyphen in an adjacent cell, if you enter 1 in B1 =LEFT(A1,B1)&"-"&RIGHT(A1,(LEN(A1)-B1)) will give you G-212DA, enter 2 and you have G2-12DA Regards, Alan. But "mePenny" wrote in message ... My mistake.. not all need it after the first character. I also need after second: example: GA02004 Example: GA-02004 "Alan" wrote: Assuming you always want the hyphen after the first character, =LEFT(A1,1)&"-"&RIGHT(A1,(LEN(A1)-1)) Regards, Alan. "Penny" wrote in message ... I would like to add a hypen to the text that exists on the excel sheet. Is there a formula for this? example of text on sheet without hypen: G212DA text with hypen: G-212DA |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding hyphen to text in cell
Thank you Alan for your help. Worked out perfectly!
"Alan" wrote: Change the formula to, =LEFT(A1,2)&"-"&RIGHT(A1,(LEN(A1)-2)) You could enter where you want the hyphen in an adjacent cell, if you enter 1 in B1 =LEFT(A1,B1)&"-"&RIGHT(A1,(LEN(A1)-B1)) will give you G-212DA, enter 2 and you have G2-12DA Regards, Alan. But "mePenny" wrote in message ... My mistake.. not all need it after the first character. I also need after second: example: GA02004 Example: GA-02004 "Alan" wrote: Assuming you always want the hyphen after the first character, =LEFT(A1,1)&"-"&RIGHT(A1,(LEN(A1)-1)) Regards, Alan. "Penny" wrote in message ... I would like to add a hypen to the text that exists on the excel sheet. Is there a formula for this? example of text on sheet without hypen: G212DA text with hypen: G-212DA |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding hyphen to text in cell
That's good. If you want to make the result permanent, ie lose the formulas,
highlight the whole range, right click 'Copy', right click again, 'Paste Special', check 'Values', OK. You can then copy and paste the list to overwrite the original list. Best to do this in a copy of the workbook. Regards, Alan. "mePenny" wrote in message ... Thank you Alan for your help. Worked out perfectly! "Alan" wrote: Change the formula to, =LEFT(A1,2)&"-"&RIGHT(A1,(LEN(A1)-2)) You could enter where you want the hyphen in an adjacent cell, if you enter 1 in B1 =LEFT(A1,B1)&"-"&RIGHT(A1,(LEN(A1)-B1)) will give you G-212DA, enter 2 and you have G2-12DA Regards, Alan. But "mePenny" wrote in message ... My mistake.. not all need it after the first character. I also need after second: example: GA02004 Example: GA-02004 "Alan" wrote: Assuming you always want the hyphen after the first character, =LEFT(A1,1)&"-"&RIGHT(A1,(LEN(A1)-1)) Regards, Alan. "Penny" wrote in message ... I would like to add a hypen to the text that exists on the excel sheet. Is there a formula for this? example of text on sheet without hypen: G212DA text with hypen: G-212DA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Extracting (Copying) Text to the Right of a Hyphen | Excel Discussion (Misc queries) | |||
hyphen (nit minus) in cell | Excel Discussion (Misc queries) | |||
Copy Text to Right of Hyphen | Excel Discussion (Misc queries) | |||
Truncating text before a hyphen | Excel Worksheet Functions | |||
How do you change sort defaults for combined text number & hyphen. | Excel Discussion (Misc queries) |