Nested IF functions error message

excelrocksmysocks

New Member
Joined
Dec 13, 2016
Messages
1
My nested if function returns the error message "too many arguments" even though there are only 4. If someone can help edit my function that'd be great.
This is my final formula
=IF((AND(B$1<=150,$A2<=100)),(16.88*$A2+20.99*B$1)-(8.7*$A2+11.51*B$1),IF((AND(B$1>=150,$A2>=100)),(16.88*$A2+20.99*B$1)-(8.7*$A2+11.51*B$1)),IF((AND(B$1>150,$A2<100)),((16.88*$A2+20.99*350+(MIN(B$1-150,100-$A2))*0.42*20.99)-(8.7*$A2+11.51*B$1)),IF((AND(B$1<150,$A2>100)),((16.88*100+20.99*B$1+(MIN($A2-100,150-B$1))*0.75*16.88)-(8.7*$A2+11.51*B$1)))))
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Anand Sharma

Board Regular
Joined
Nov 22, 2016
Messages
63
Hi

Try using below formula and change the result multiplication and adding values as I changed structure of formula only

=IF(AND(B$1<=150,$A2<=100), ((16.88*$A2)+(20.99*B$1)) - ((8.7*$A2)+(11.51*B$1)),
IF(AND(B$1>=150,$A2>=100), ((16.88*$A2)+(20.99*B$1)) - ((8.7*$A2)+(11.51*B$1)),
IF(AND(B$1>150,$A2<100), ((16.88*$A2)+(20.99*B$1)) - ((8.7*$A2)+(11.51*B$1)),
IF(AND(B$1<150,$A2>100), ((16.88*$A2)+(20.99*B$1)) - ((8.7*$A2)+(11.51*B$1)), ""))))
 

LateralThinker

New Member
Joined
May 7, 2014
Messages
11
Try this
=IF(AND(B$1<=150,$A2<=100),(16.88*$A2+20.99*B$1)-(8.7*$A2+11.51*B$1),
IF(AND(B$1>=150,$A2>=100),(16.88*$A2+20.99*B$1)-(8.7*$A2+11.51*B$1),
IF(AND(B$1>150,$A2<100),((16.88*$A2+20.99*350+(MIN(B$1-150,100-$A2))*0.42*20.99)-(8.7*$A2+11.51*B$1)),
IF(AND(B$1<150,$A2>100),((16.88*100+20.99*B$1+(MIN($A2-100,150-B$1))*0.75*16.88)-(8.7*$A2+11.51*B$1))))))
 
Last edited:
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,542
Messages
5,832,346
Members
430,128
Latest member
ojl987

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top