Text extract formula in Excel

Hi guys!

 The question is this:
I have fiew strings that i have to
extract text from.

JOHNNIE WALKER BLACK.CY
JOHNNIE WALKER BLACK 200ML/FL.CY
and
JOHNNIE WALKER BLACK 1.75L.CY
CY means - Current Year

  For the first two I have a formula
 which works fine:
    =LEFT(O9,FIND(".",O9)-1)
 O9 is where the string is.
 It returns just the name without CY,
 exactly what I need.
  But on the 3 one it wouldn't work
 because it has 2 periods.

    I need a universal formula for any
 size of the string, which will extract
 me just the name. CY is constant on
 every entry.

   Appriciated, Misha1


LVL 1
misha1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

blakeh1Commented:
if the string always ends in cy use the following

=LEFT(09,LEN(O9)-3)
0
blakeh1Commented:
sorry meant to post it as an answer
if the string always ends in cy use the following

=LEFT(09,LEN(O9)-3)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
antratCommented:
Hi misha1

If you need to return all you text accept .CY then this formula will work universally.

=REPLACE(O9,FIND(".CY",O9),3,"")


It is case sensitive though.
Antrat
0
calacucciaCommented:
Or you could use your old formule and just replace the "." look-up string by a refined string ".CY"

Geert
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.