If(AND) combination produces "You've entered too many arguments for this function" error

Solution 1:

Generally

When you get the error You've entered too many arguments for this function than you don't use the allowed number of arguments. It may be helpfull to copy the whole line to notepad and check the arguments.

All functions with the allowed arguments can be found there:

Excel functions by Microsoft

Your special case

IF() accepts only three parameters, like:

=if(C2="A","is A", "is something else")

You can take two decisions: "is A", "is something else".


To take three decisions you need nested IF(), expand it like this:

=if(C2="A","is A", if(C2="B", "is B", "is something else"))

Now you can decide: "is A", "is B", "is something else".


To take four decisions expand it like this:

=if(C2="A","is A", if(C2="B", "is B", if(C2="C", "is C", "is something else")))

This is why you get the error. You are using more than three parameters:

=IF(AND(C2 = "Low", X2 <= 168), "Met", "Not Met",IF(AND(C2 = "Medium", X2 <= 96)

Transform your statement the way above and it will work!


Edit:
To use a combination of AND() and OR() in an IF()-function, you may use someting like this:

=IF(OR(AND(C2 = "Low", X2 <= 168), AND(C2 = "Medium", X2 <= 96), AND(C2 = "High", X2 <= 20)), "MET", "NOT MET")