PDA

View Full Version : IF and OR .... Can't seem to work it out.



ashleyuk1984
06-05-2014, 08:45 AM
I have the following two formulas that work independently.


=IFERROR(IF(FIND(LEFT(E$1,3),$B2,1)>0,"X",""),"")
and

=IFERROR(IF(FIND(LEFT(E$1,3),$C2,1)>0,"X",""),"")

I need to basically combine these into one formula...
I've tried the following.



=IFERROR(IF(OR(FIND(LEFT(D$1,3),$B2,1),FIND(LEFT(D$1,3),$C2,1))>0,"X",""),"")

This returns no results to my query.

and I've also tried this. (without OR)


=IFERROR(IF(FIND(LEFT(D$1,3),$B2,1)>0,"X",IF(FIND(LEFT(D$1,3),$C2,1)>0,"X")),"")

Now this one, appears to work for the first condition, but doesn't work for the second condition?

Could someone please advise me what the problem is?
Thanks

Bob Phillips
06-05-2014, 09:17 AM
Try

=IF(OR(ISNUMBER(FIND(LEFT(D$1,3),$B2,1)),ISNUMBER(FIND(LEFT(D$1,3),$C2,1))) ,"X","")

ashleyuk1984
06-05-2014, 10:12 AM
Thanks xld
ISNUMBER!! Works perfectly.

Rep added.

Bob Phillips
06-05-2014, 10:53 AM
Can you see why, or do you want it explained?

snb
06-06-2014, 09:34 AM
or

=IF(ISERR(FIND(LEFT(D$,3),B2&C2)),"","X")