# Nested IF functions giving Too Many Arguments error

#### Stuepef

##### Board Regular
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:
 Column A Column B Column C IF formula below Base Salary? Employee % Company % Employee \$ Company \$ Job Title Employee % Company % Employee Job Title Bobby Officer Ricky Officer Tiesto Officer Robert Officer

<tbody>
</tbody>

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:
 Column A Column B Column C Column D Column E Column F Column G Name Yrs. of Service Promotions Bonus Company Vendor Total Bobby 0 0 100 200 0 300 Ricky 10 1 100 200 100 400 Tiesto 0 0 250 500 0 750 Robert 3 1 300 600 0 900

<tbody>
</tbody>

-----------------------------------------------------------------------------------------------------------------------------------
The Base Bonus Tab is formatted like this:
 Column A Column B Name Base Bonus Bobby 50 Ricky 100 Tiesto 300 Robert 300

<tbody>
</tbody>
-----------------------------------------------------------------------------------------------------------------------------------
The Summary Tab is formatted like this:
 Column A Column B Name Total Bonus Bobby Formulas based on combination Ricky Formulas based on combination Tiesto Formulas based on combination Robert Formulas based on combination

<tbody>
</tbody>
-----------------------------------------------------------------------------------------------------------------------------------

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.

#### Stuepef

##### Board Regular
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)))``

1,082,250
Messages
5,364,022
Members
400,774
Latest member
Goldi paul

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
• Complex Heat Map using conditional formatting
Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
• Conditional formatting
Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...