Having some trouble with IF function in a complicated (well, it is pretty simple, it is just long) formula.

Unsolved

This function is kind of getting long and complicated, but it is how I need it. Below is the original formula:

=if(A11="","",if(J11>5,multiply(multiply(Y11,0.7)+multiply(Z11,0.3),100),multiply(multiply(multiply(Y11,0.7)+multiply(Z11,0.3),100),5/J11)))

​

This worked perfectly for what I needed, except for the fact that whenever J11 = 0, the function would not work, because you cannot divide by 0. So I made the below function.

​

=if(A11="","",if(J11>5,multiply(multiply(Y11,0.7)+multiply(Z11,0.3),100),if(J11=0,multiply(multiply(multiply(Y11,0.7)+multiply(Z11,0.3),100),7.5)),multiply(multiply(multiply(Y11,0.7)+multiply(Z11,0.3),100),5/J11)))

​

But, it is giving an error message of " Wrong number of arguments to IF. Expected between 2 and 3 arguments, but got 4 arguments". Each IF function has two outcomes, but maybe because I am using IF functions inside of other IF functions, I messed up the parentheses placement so it makes google sheets thing I used 3+ outcomes in one IF statement. That is what I think the problem is, but I am not certain.

​

If anyone sees where I messed up on my parentheses, please let me know. If it is not the parentheses placement that is messing up this function, and you see a different problem, also please let me know.

Posted Jul 4, 2021, 4:35 AM UTC

313
Loading comments…