Nested or statement

doug firr

Board Regular
Joined
Mar 28, 2011
Messages
140
I'd like to check whether a string of text in a cell contains either "something" or "somethingelse".

IF(ISNUMBER(FIND($F$5,D8)),$F$4,0) OR IF(ISNUMBER(FIND($F$6,D8)),$F$4,0)

The result should either output the contents of cell F4 if True or 0 otherwise.

I've tried a few nestings with no luck: IF(ISNUMBER(FIND(or($F$5,D8),($F$6,D8)),$F$4,0)) - too many arguments.

I want to say "find either the text in F5 or the text in F6, if you find either output whats in F4".
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi,

Couple of possibilities:

=IF(SUMPRODUCT(COUNTIF(D8,"*"&$F$5:$F$6&"*")),$F$4,0)

=IF(ISNUMBER(LOOKUP(67^11,FIND($F$5:$F$6,D8))),$F$4,0)


Regards
 
Upvote 0
I made it with: =IF(OR(ISNUMBER(FIND($F$5,D8)),ISNUMBER(FIND($F$6,D8))),$F$4,0)

What do ^ and "*" do?
 
Upvote 0
Yes. What you used is perfectly good. I was just offering some slightly unusual alternatives :)

^ is the symbol for "to the power of" and * represents a wildcard when used in conjunction with certain (i.e. search) functions.

Regards
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,184
Members
448,554
Latest member
Gleisner2

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