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".
 

Some videos you may like

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

XOR LX

Well-known Member
Joined
Jul 2, 2012
Messages
4,517
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
 

doug firr

Board Regular
Joined
Mar 28, 2011
Messages
140
I made it with: =IF(OR(ISNUMBER(FIND($F$5,D8)),ISNUMBER(FIND($F$6,D8))),$F$4,0)

What do ^ and "*" do?
 

XOR LX

Well-known Member
Joined
Jul 2, 2012
Messages
4,517
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
 

Watch MrExcel Video

Forum statistics

Threads
1,118,415
Messages
5,571,975
Members
412,430
Latest member
Huuktkt
Top