Extract Text After A Specified Word

I need to be able to extract the first word after "created by" in an excel cell, some of the cells do not have a "Created by" in them so i just want to return a null value. there is a large string within each cell. can you help me with this?
bryanscott53Asked:
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.

Saqib Husain, SyedEngineerCommented:
=MID(A1,FIND("created by",LOWER(A1))+11,FIND(" ",A1,FIND("created by",A1)+11)-FIND("created by",LOWER(A1))-11)
0
StephenJRCommented:
There has to be a shorter way:

=IF(ISNUMBER(FIND("created by",H22)),MID(H22,FIND("created by",H22)+11,IF(ISNUMBER(FIND(" ",H22,FIND("created by",H22)+11)),FIND(" ",H22,FIND("created by",H22)+11),LEN(H22))-FIND("created by",H22)-10),"")
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
redmondbCommented:
Following handles missing "created by " and also single word after it (requires Excel 2007/2010 - let me know if you use an earlier version)...

=IFERROR(MID(A1,FIND("created by ",A1,1)+11,IFERROR(FIND(" ",A1,FIND("created by ",A1,1)+11)-FIND("created by ",A1,1)-11,9999)),"")

Regards,
Brian.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

barry houdiniCommented:
Hello Saqib,

If you use SEARCH then that is not case-sensitive (so you don't need LOWER), i.e.

=TRIM(REPLACE(A1,1,SEARCH("Created by",A1&"Created by")+9,""))

That returns a blank if "Created by" isn't in A1. Use FIND instead of SEARCH if you do want case-sensitivity

regards, barry

0
bryanscott53Author Commented:
ssaqibh apologies but i was getting a #Value error

StephenJR yours worked perfect thanks saved me days!
0
redmondbCommented:
StephenJR,

Nice (pre-2007 "compliant"), but needs a Trim()...

=trim(IF(ISNUMBER(FIND("created by",H22)),MID(H22,FIND("created by",H22)+11,IF(ISNUMBER(FIND(" ",H22,FIND("created by",H22)+11)),FIND(" ",H22,FIND("created by",H22)+11),LEN(H22))-FIND("created by",H22)-10),""))

Regards,
Brian.
0
Saqib Husain, SyedEngineerCommented:
Barry, thumbs up.
0
barry houdiniCommented:
Oh, did I miss "first word"....must brush up on my reading skills.....

FWIW you could try this

=TRIM(REPLACE(LEFT(A1,FIND(" ",A1&"Created by x ",SEARCH("Created by",A1&"Created by")+11)),1,SEARCH("Created by",A1&"Created by")+9,""))

regards, barry
0
Muhammad KhanManager, ITCommented:
or this

=MID(A2,FIND("Created By",A2)+LEN("Created By")+1,FIND(" ",A2,FIND("Created By",A2,1)+LEN("Created By "))-(FIND("Created By",A2,1)+LEN("Created By")))
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 Excel

From novice to tech pro — start learning today.