Extracting (Copying) Text to the Right of a Hyphen

  • Thread starter Thread starter ConfusedNHouston
  • Start date Start date
C

ConfusedNHouston

In this case it's a hypen but I assume it could be any symbol or letter. I
have text in column A in the following formats:

TEXT-01
TEXT-0004
TEXTTEXT-20
TEXTANDTEXT-1000

I want to get everything after the hyphen into column B

So column B would look like

-01
-0004
-20
-1000

I dont' really care if the hyphen is extracted or not. I'd like to know how
to do this both with and without extracting the hyphen. If possible.

Thanks
 
To extract with the hyphen:

=MID(A1,FIND("-",A1),255)

To extract without the hyphen:

=MID(A1,FIND("-",A1)+1,255)
 
=MID(A1,FIND("-",A1),255)

assuming there are no other hyphens earlier in the text string



--


Regards,


Peo Sjoblom
 
You can use a formula like

=MID(A1,FIND("-",A1),LEN(A1))

To make the "-" character a variable, put that character in some cell, say
C1, and use

=MID(A1,FIND(C1,A1),LEN(A1))

If the character isn't found, you'll get a #VALUE error.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
Back
Top