If either of two conditions met (partial text string), return text A or text B

Churchy LaFemme

Board Regular
Joined
Sep 22, 2010
Messages
135
My table may have either This or That in column B.

Column B
This thing
That thing
Ain't no thang
And another thing
Are you going to eat that
This I no big deal
That is a lie

I need a formula in Column C which will return "Eureka" if either "this" or "that" is in column b.

For some reason my efforts to use a nested if with wildcards is a big fat fail. (It's as if using * in a nested if breaks Excel.)

I can get a TRUE or FALSE result with this formula.

=OR(ISNUMBER(SEARCH({"*This*","*That*"},B2]])))

What can I do to change TRUE to Eureka?

Or is there another way?

(Found at least two similar questions - but was unable to return to them after logging in.)
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
There may be a better way, but this works:

=IF(ISNUMBER(IFERROR(SEARCH("This",B2,1),SEARCH("That",B2,1))),"Eureka","")
 
Upvote 0
This is one way


Excel 2010
BC
1This thingEureka
2That thingEureka
3Ain't no thangNot found
4And another thingNot found
5Are you going to eat thatEureka
6This I no big dealEureka
7That is a lieEureka
Sheet9
Cell Formulas
RangeFormula
C1=IF(OR(IFERROR(SEARCH("This",$B1)>0,0),IFERROR(SEARCH("That",$B1)>0,0)),"Eureka","Not found")
 
Upvote 0
This works, don't know if it is what you want:

=IFERROR(IF(FIND("that",B1,1)>0,"Eureka",""),"Nope")
 
Upvote 0
I was working on this one and ended up with something very similar to the other answers here, however it wasn't working. I didn't have any IFERROR in my expression. Why is that needed?
 
Upvote 0
I was working on this one and ended up with something very similar to the other answers here, however it wasn't working. I didn't have any IFERROR in my expression. Why is that needed?

When the search doesn't find the expression, it returns #Value (an error) and messes up the IF statement, so the IFERROR is to cater for such instances
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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