# Excel IF Function containing the AND and OR FUnction



## aljrab (Jun 15, 2007)

A B
SO number	SO item
1: 12217379	1100
2: 12217379	1100
3: 12837633	200
4: 12837633	300
5: 12894024	100


Hi i am trying to have a formula that lets me test IF A3=A4 and IF B3= B4 OR IF A3=A2 and B3=B2 then return double if both conditions are false then return OK 

At the moment I am only able to test one of my conditions IF((AND(A3=A4,B3=B4)),"Double", "OK") 

but I am not knowing how to integrate the OR function in to the formula\

Any help would be much appreciated 

Thanks


----------



## Baldspot (Oct 25, 2007)

The AND function gives a True result if All arguments are true. 

The OR function gives a True result if Any of the arguments are true:

Here is my data:

COLUMNS ..... A..B..C..D.

ROW 1: .........1 . 1 . 3 . 3 ........=IF(OR(A2=B2,C2=D2),"T","F") = "T"

ROW 2: .........1 . 1 . 3 . 4.........=IF(OR(A3=B3,C3=D3),"T","F") = "T"

ROW 3: .........1 . 2 . 3 . 4 ........=IF(OR(A4=B4,C4=D4),"T","F") = "F"

The OR function can test up to 30 conditions.

=IF(OR(A1=B1,C2=D2,A3=B3,C3=D3),"Y","N") = Y

:grin:​


----------



## aljrab (Jun 15, 2007)

Thanks Mate!


----------

