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 ?
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)
cbarroso
Dec 06, 2021Brass Contributor
I guess the formula is working but the resul is not what you expect 🙂
Can u provide a sample of data with the expected result?
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
kmcdermott1974take my file, maybe your excel is not in English so the formula should be wrote in another langage.
- cbarrosoDec 06, 2021Brass Contributor
kmcdermott1974
On my side this is workingE36 400,00 € 400,00 € E38 2 240,00 € 300,00 € E41 2 410,00 € 300,00 € E43 400,00 € 0,00 € (=IF(AND(E36<E41;E38>E36);E36;0))Perhaps your cells are considered as TEXT and not as number, can you double check the type of the cells? In this sample what result the formula is giving you?
- cbarrosoDec 06, 2021Brass Contributor
A B C RESULT (IF(AND(B2>A2;B2<C2);B2;0)) 1 2 3 2