Nested IF functions giving Too Many Arguments error

Stuepef

Board Regular
Joined
Oct 23, 2017
Messages
128
Office Version
  1. 2021
Platform
  1. Windows
I have a workbook where I input information in specific cells to create combinations to calculate employee bonuses. My workbook has 4 tabs:
  1. Data
  2. Bonus
  3. Base Bonus
  4. Summary

The Data tab is formatted like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Column A[/TD]
[TD="align: center"]Column B[/TD]
[TD="align: center"]Column C[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]IF formula below[/TD]
[/TR]
[TR]
[TD]Base Salary?[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Employee %[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Company %[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Employee $[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Company $[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Job Title[/TD]
[TD]Employee %[/TD]
[TD]Company %[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]Employee[/TD]
[TD]Job Title[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Bobby[/TD]
[TD]Officer[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Ricky[/TD]
[TD]Officer[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Tiesto[/TD]
[TD]Officer[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Robert[/TD]
[TD]Officer[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


C1 IF formula calculates based on the combinations listed below:
Code:
=IF(AND($B$2<>"",$A$8<>"",$B$8<>""),5,IF(AND($B$2<>"",$B$3<>""),3,IF($B$3<>"",1,IF($B$5<>"",2))))

Here are the different combinations numbered 1,2,3,5:
Employee % (cell B3) & Company % (cell B4) cells have numbers inputted = Combo 1
Employee $ (cell B5) & Company $ (cell B6) cells have numbers inputted =Combo 2
Base Salary (B2) is Yes & Employee % (cell B3) cells have been inputted = Combo 3
Base Salary (B2) is Yes & Job Title (A8) & Employee % (cell B8) cell have been inputted = Combo 5


I will further explain combo 3 specifically - If the base bonus is less than the regular bonus, than multiply the base bonus * Employee % + Company&Vendor bonus * Company %. If base bonus is more than regular bonus, than multiply regular bonus * Employee % + Company&Vendor bonus * Company %. Example:

Bobby
Base Bonus $50 < Regular Bonus $100
$50 * 50% employee % = $25
+ $200 company + $0 vendor * 50% company = $100
Final answer is $125 if base bonus is < regular bonus

I will further explain combo 5 specifically - If the base bonus is less than the regular bonus, than multiply the base bonus * employees job title Employee % + Company&Vendor bonus * job title Company %. If base bonus is more than regular bonus, than multiply regular bonus * employees job title Employee % + Company&Vendor bonus * job title Company %. Example:

Bobby
Base Bonus $50 < Regular Bonus $100
Find Bobby's Job title to determine Employee % & Company %
75% Employee % for Officers and 50% Company %
75% * $50 + 50% * ($200 Company & $0 Vendor) = $137.5
Final answer is $137.5 of base bonus is < regular bonus
---------------------------------------------------------------------------------------------------------------------------------

The Bonus Tab is formatted like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Column E[/TD]
[TD]Column F[/TD]
[TD]Column G[/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Yrs. of Service[/TD]
[TD]Promotions[/TD]
[TD]Bonus[/TD]
[TD]Company[/TD]
[TD]Vendor[/TD]
[TD]Total[/TD]
[/TR]
[TR]
[TD]Bobby[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]100[/TD]
[TD]200[/TD]
[TD]0[/TD]
[TD]300[/TD]
[/TR]
[TR]
[TD]Ricky[/TD]
[TD]10[/TD]
[TD]1[/TD]
[TD]100[/TD]
[TD]200[/TD]
[TD]100[/TD]
[TD]400[/TD]
[/TR]
[TR]
[TD]Tiesto[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]250[/TD]
[TD]500[/TD]
[TD]0[/TD]
[TD]750[/TD]
[/TR]
[TR]
[TD]Robert[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]300[/TD]
[TD]600[/TD]
[TD]0[/TD]
[TD]900[/TD]
[/TR]
</tbody>[/TABLE]

-----------------------------------------------------------------------------------------------------------------------------------
The Base Bonus Tab is formatted like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Column A[/TD]
[TD="align: center"]Column B[/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Base Bonus[/TD]
[/TR]
[TR]
[TD]Bobby[/TD]
[TD]50[/TD]
[/TR]
[TR]
[TD]Ricky[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]Tiesto[/TD]
[TD]300[/TD]
[/TR]
[TR]
[TD]Robert[/TD]
[TD]300[/TD]
[/TR]
</tbody>[/TABLE]
-----------------------------------------------------------------------------------------------------------------------------------
The Summary Tab is formatted like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Column A[/TD]
[TD="align: center"]Column B[/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Total Bonus[/TD]
[/TR]
[TR]
[TD]Bobby[/TD]
[TD]Formulas based on combination[/TD]
[/TR]
[TR]
[TD]Ricky[/TD]
[TD]Formulas based on combination[/TD]
[/TR]
[TR]
[TD]Tiesto[/TD]
[TD]Formulas based on combination[/TD]
[/TR]
[TR]
[TD]Robert[/TD]
[TD]Formulas based on combination[/TD]
[/TR]
</tbody>[/TABLE]
-----------------------------------------------------------------------------------------------------------------------------------

The issue I am having is when I combine all of the formulas together, I receive the Too Many Arguments error message. I would like to avoid making a secondary calculation table, but I am open to resolution options. Here are the formulas by combination that I would like to see if they can be put together into one large formula. See Next Comment for formulas.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Combo 1:
Code:
=IF(Data!$C$1=1,Data!$B$3*Bonus!B2+Data!$B$4*(Bonus!C2+Bonus!D2))

Combo 2:
Code:
=IF(Data!$C$1=2,Data!$B$3*Bonus!D2+Data!$B$4*(Bonus!E2+Bonus!F2),IF(Data!$C$1=2,IF(SUM(Bonus!B2:C2)<1,0,1)*Data!$B$6+Data!B5))

Combo 3:
Code:
=IF(Data!$C$1=3,IF(VLOOKUP(Summary!A2,'Base Bonus'!$A$2:$B$5,2,FALSE)< VLOOKUP(Summary!A2,Bonus!$A$2:$D$5,4,FALSE),VLOOKUP(Summary!A2,'Base Bonus'!$A$2:$B$5,2,FALSE)*Data!$B$3+Data!$B$4*(Bonus!E2+Bonus!F2),VLOOKUP(A2,Bonus!$A$2:$D$5,4,FALSE)*Data!$B$3+Data!$B$4*(Bonus!E2+Bonus!F2)))

Combo 5:
Code:
=IF(Data!$C$1=5,IF(VLOOKUP(Summary!A2,'Base Bonus'!$A$2:$B$5,2,FALSE)< VLOOKUP(Summary!A2,Bonus!$A$2:$D$5,4,FALSE),VLOOKUP(Summary!A2,'Base Bonus'!$A$2:$B$5,2,FALSE)*VLOOKUP(VLOOKUP(Summary!A2,Data!$A$16:$B$19,2,FALSE),Data!$A$8:$C$11,2,FALSE)+(Bonus!E2+Bonus!E2)*VLOOKUP(VLOOKUP(Summary!A2,Data!$A$16:$B$19,2,FALSE),Data!$A$8:$C$11,3,FALSE),VLOOKUP(A2,Bonus!$A$2:$D$5,4,FALSE)*VLOOKUP(VLOOKUP(Summary!A2,Data!$A$16:$B$19,2,FALSE),Data!$A$8:$C$11,2,FALSE)+(Bonus!E2+Bonus!E2)*VLOOKUP(VLOOKUP(Summary!A2,Data!$A$16:$B$19,2,FALSE),Data!$A$8:$C$11,3,FALSE)))
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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
Back
Top