Forum Discussion
kmcdermott1974
Dec 06, 2021Copper Contributor
IF statement with 2 variables
Can someone assist. If 2<3 and 1>2, true = 2 false = 0 How do I write this IF statement ?
cbarroso
Dec 06, 2021Brass Contributor
Something like:
IF(AND(2 < 3; 1 > 2); 2; 0)
IF(AND(2 < 3; 1 > 2); 2; 0)
kmcdermott1974
Dec 06, 2021Copper Contributor
I have tried and its not working
=IF(AND(E36 < E41; E38 > E36); E36; 0)
=IF(AND(E36 < E41; E38 > E36); E36; 0)
- cbarrosoDec 06, 2021Brass ContributorI guess the formula is working but the resul is not what you expect 🙂
Can u provide a sample of data with the expected result?- kmcdermott1974Dec 06, 2021Copper Contributor
E36=$400
E38=$2240
E41= $2410
E43=formula
so IF E36<E41 and E38>E36 YES then E43 = E36 NO then E43=0
400<2410 YES and 2240>400 YES then E43=$400
Further to this IF E36<E41 and E38<E36 YES then E43=E36 NO then E43=0
- kmcdermott1974Dec 06, 2021Copper Contributortried yours exactly still comes up with problem. even added = before IF and still problem ?!?
- cbarrosoDec 06, 2021Brass Contributor
A B C RESULT (IF(AND(B2>A2;B2<C2);B2;0)) 1 2 3 2