You've entered too many arguments for this function.

Anonymous
2022-03-27T22:08:33+00:00

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

Microsoft 365 and Office | Excel | For education | MacOS

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.

0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. HansV 462.4K Reputation points MVP Volunteer Moderator
    2022-03-27T22:17:48+00:00

    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,)

    0 comments No comments
  2. Anonymous
    2022-03-27T22:33:57+00:00

    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

    0 comments No comments
  3. Anonymous
    2022-03-28T01:19:39+00:00

    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

    0 comments No comments
  4. Anonymous
    2022-03-28T01:35:43+00:00

    > ... 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))

    0 comments No comments
  5. Anonymous
    2022-03-28T01:09:50+00:00

    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:

    1. Replace the "??" in the formula with the corresponding division for the combination i.e. D3/C3 or B3/C3
    2. The 4th combination (row 6) corresponds to the first AND statement in the formula you provided AND(G3=FALSE, E3=TRUE, F3=TRUE) orderly ===>> AND(E3=TRUE, F3=TRUE,G3=FALSE)==>>TRUE,TRUE,FALSE
    3. Column I (Combination) in the picture below is just for illustration purposes, to show the formula that returns/assigns the right combination number which is the same used within the formula solution.

    Image

    I hope this helps you and gives a solution to your problem

    Do let me know if you need more help

    Regards

    Jeovany

    0 comments No comments