Equivalent of InStr and InStrRev in excel

TheBuGz

Spammer
Joined
Jan 25, 2004
Messages
367
How to use the following VBA functions

InStr
InstrRev


In excel
 
Rick, yes, this works, thank you.
I also found some variations of my own, if you'd be interested in trying them out:

Case Sensitive
=IF(ISERROR(FIND(D73,B73)),"-",FIND(D73,B73))

Case Insensitive using UPPER
=IF(ISERROR(FIND(UPPER(D74),UPPER($B$70))),"-",FIND(UPPER(D74),UPPER($B$70)))

Case Insensitive replacing FIND with SEARCH
=IF(ISERROR(SEARCH(D75,B75)),"-",SEARCH(D75,B75))

In all cases, column B is the string being searched and column D is the string being searched FOR.

Cheers

Pete
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
That works as Instr not InstrRev though. For the latter you can also use this non-array-entered version:
=LOOKUP(1E+100,SEARCH(A1,MID(B1,ROW(INDIRECT("1:"&LEN(B1))),LEN(A1))),ROW(INDIRECT("1:"&LEN(B1))))
 
Upvote 0
That works as Instr not InstrRev though. For the latter you can also use this non-array-entered version:
=LOOKUP(1E+100,SEARCH(A1,MID(B1,ROW(INDIRECT("1:"&LEN(B1))),LEN(A1))),ROW(INDIRECT("1:"&LEN(B1))))
I would note that your formula is Volatile... I believe this modification to it would make it non-Volatile and yet still keep it working...

=LOOKUP(1E+100,SEARCH(A1,MID(B1,ROW(INDEX(A:A,1):INDEX(A:A,LEN(B1))),LEN(A1))),ROW(INDEX(A:A,1):INDEX(A:A,LEN(B1))))
 
Upvote 0
True - but if I had a lot of those, I'd rethink my workbook! :)
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top