Help - combine OR and AND in IF function

S

svenk

Hi,
could you help me figure out how to combine OR and AND in an IF
function:

Basically I want to say:

IF cell A>0 and cell B="x" assign the number from cell C to Cell D
IF cell A>0 and cell B="y" assign the number from cell E to Cell D

Can I do this in one command?

Thanks for your input!!
S.
 
A

Arvi Laanemets

Hi

Into D1 enter the formula
=IF(AND(A1>0,B1="x"),C1,IF(AND(A1>0,B1="y"),E1,""))

Arvi Laanemets
 
Top