Either use
=IF(AND(G3=FALSE, E3=TRUE, F3=TRUE), D3/C3, IF(AND(F3=TRUE, G3=FALSE, E3=TRUE), B3/C3,))
or
=IFS(AND(G3=FALSE, E3=TRUE, F3=TRUE), D3/C3, AND(F3=TRUE, G3=FALSE, E3=TRUE), B3/C3, TRUE,)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I am trying to get my code to known which equations to use depending on true or false statements but its saying I have too many arguments for this function. This is my code:
=IF(AND(G3=FALSE,E3=TRUE,F3=TRUE),D3/C3, AND(F3=TRUE,G3=FALSE, E3=TRUE), B3/C3,)
Can you tell me where i'm going wrong please
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Either use
=IF(AND(G3=FALSE, E3=TRUE, F3=TRUE), D3/C3, IF(AND(F3=TRUE, G3=FALSE, E3=TRUE), B3/C3,))
or
=IFS(AND(G3=FALSE, E3=TRUE, F3=TRUE), D3/C3, AND(F3=TRUE, G3=FALSE, E3=TRUE), B3/C3, TRUE,)
Hi HansV,
The first one worked perfectly.
So, overall there are six equations that there could be depending on the statements being true or false. Will this work with more than two if statements.
When I put in the third, the same problem keeps coming up 'You've entered too many arguments for this function.'
two equations:
=IF(AND(G3=FALSE, E3=TRUE, F3=TRUE), D3/C3, IF(AND(F3=TRUE, G3=FALSE, E3=TRUE), B3/C3,))
three equations:
=IF(AND(G3=FALSE, E3=TRUE, F3=TRUE), D3/C3, IF(AND(F3=TRUE, G3=FALSE, E3=TRUE), B3/C3,), IF(AND(G3=FALSE, E3=FALSE, F3=FALSE), D3/C3))
Is there something I am doing wrong with my functions?
Thanks very much
Hi Jeovany,
Thanks very much for your reply! I found a fix, and it turns out it is basically similar to what you just said but I have mananged to include all six equations, therefore every cell waas calculated properly.
Thanks very much for the answer, I really appreciate all the help!!
Best,
Nathan
> ... So, overall, there are six equations that could be
> ... the scenario might have 7 possible combinations
As a side note, with 3 binary variables, there are 8 different values. (0-7)
000 =DEC2BIN(0,3)
111 =DEC2BIN(7,3)
The orders are 4,2,1 instead of 3,2,1
AND( E3=TRUE, F3=TRUE, G3=FALSE)
With binary inputs, another technique:
=AND(E3,F3,NOT(G3))
Hi there
Re, ... Is there something I am doing wrong with my functions?
i) I just noticed that the first and second AND statements follow the same criteria/conditions and simply the ranges are placed differently G, E, and F versus F, G, and E.
=IF(AND(G3=FALSE, E3=TRUE, F3=TRUE), D3/C3, IF(AND(F3=TRUE, G3=FALSE, E3=TRUE), B3/C3,), IF(AND(G3=FALSE, E3=FALSE, F3=FALSE), D3/C3))
1st) AND(G3=FALSE, E3=TRUE, F3=TRUE)
2nd) AND(F3=TRUE, G3=FALSE, E3=TRUE)
ii) For that reason, in this case, I always choose to orderly place the ranges (as a good practice) to avoid confusion when building a formula i.e E3, F3, and G3 exactly as columns are placed in the sheet, from left to right
iii) According to the details provided, the scenario might have 7 possible combinations/equations.
The picture below shows the 7 possible combinations and the formula solution
=CHOOSE(E3*1+F3*2+G3*3+1,"??","??","??",D3/C3,"??","??","??")
Notes:
I hope this helps you and gives a solution to your problem
Do let me know if you need more help
Regards
Jeovany