Try:
=MID(A1,SEARCH(B1,A1),SEARCH(" ",MID(A1&" ",SEARCH(B1,A1),255)))
Where A1 contains original string and B1 contains string to search for.
Try:
=MID(A1,SEARCH(B1,A1),SEARCH(" ",MID(A1&" ",SEARCH(B1,A1),255)))
Where A1 contains original string and B1 contains string to search for.
Where there is a will there are many ways.
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
It should also work with word at end of sentence...
I tested it with your example#2 and got the expected result.
Have you tried it? What error do you get?
Hi,
Just adding to NBVC example and looking at your very first example where its enclosed in brackets, you may need something like this
![]()
=IF(RIGHT(MID(A1,SEARCH(B1,A1),SEARCH(" ",MID(A1&" ",SEARCH(B1,A1),255))),2)=") ",LEFT(MID(A1,SEARCH(B1,A1),SEARCH(" ",MID(A1&" ",SEARCH(B1,A1),255))),LEN(MID(A1,SEARCH(B1,A1),SEARCH(" ",MID(A1&" ",SEARCH(B1,A1),255))))-2))
oldchippy
-------------
![]()
![]()
Blessed are those who can give without remembering and take without forgetting
If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.
Click here >>> Top Excel links for beginners to Experts
Forum Rules >>>Please don't forget to read these
Sorry error in my last formula, but this will work with both brackets and non-brackets
![]()
=IF(RIGHT(MID(A2,SEARCH(B2,A2),SEARCH(" ",MID(A2&" ",SEARCH(B2,A2),255))),2)=") ",MID(A2,SEARCH(B2,A2),SEARCH(" ",MID(A2&" ",SEARCH(B2,A2),255))-2),MID(A2,SEARCH(B2,A2),SEARCH(" ",MID(A2&" ",SEARCH(B2,A2),255))))
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks