Home

how to find occurences of a word before or after a specific word in an excel cell

Lonewalker365
New Contributor

Hello Everyone,

I am facing an issue for some time and I have realised that there is no better place to ask for a solution of it than this place. So, here it goes.

 

suppose there is an address line like " YSR Residency opposite of Vodafone Mobile store" in an excel cell. Now, I am looking for a macro query or and excel formula which, if executed, will tell me whether the word "opposite" appeared before the word "Mobile" or after the word "Mobile". Obviously the result must appear in the adjacent right side cell of the cell in which address is present.

 

Thanks a lot for your help and time.

1 Reply

Hi,

 

As simple variant

=IFERROR(IF(SEARCH("opposite",A1)<SEARCH("mobile",A1), "before", "after"),"no such pair")
Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
22 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
PacketMon Components are not loading in WAC 1909
HotCakeX in Windows Admin Center on
2 Replies