Find text within cell then display text to left

J

Jambruins

In cell E2 I have the following:
St Louis Cardinals vs Pittsburgh Pirates for Game

In cell E10 I have the following:
Chicago Cubs vs Los Angeles Dodgers for Game

I would like a formula in cell K2 to do the following:
Find the vs in cell E2 and then display all the text to the left of it (St
Louis Cardinals in this case). I included the cell E10 info so you can see
that the text to the left of the vs is not the same number of characters so I
can't just use the left formula. Any ideas? Thanks.
 
R

Ron Coderre

Try this:

K2: =LEFT(E2,SEARCH(" vs",E2)-1)

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro
 
B

Biff

You're welcome. Thanks for the feedback!

If you want to extract Pittsburgh Pirates:

=MID(E2,FIND(" vs ",E2)+4,FIND(" for ",E2)-(FIND(" vs ",E2)+3))

Biff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top