PDA

View Full Version : [SOLVED:] Insert a Hyphen at two characters from the end of a String



James Niven
08-13-2013, 07:46 AM
Hi,

I have text in Column A starting at A2 as XHDIFM and as XHCRSFM.
I wish to insert a hyphen two characters from the end of each string, so the above text will look like XHDI-FM and XHCRS-FM

I have googled but get nothing close to what I want.

Can someone please offer a solution??

Kenneth Hobs
08-13-2013, 09:44 AM
B2 and copy down.
=LEFT(A2,LEN(A2)-2)&"-"&RIGHT(A2,2)

James Niven
08-13-2013, 11:55 AM
Thanks Kenneth, worked like a charm
Much appreciated!!