# Nesting If Functions

#### nelsonjos

##### New Member
Hello,

I am working on creating a payroll. I am attempting to add a line to how much medical insurance will be taken out each paycheck. The parameters that I need to follow are: \$30 automatically is taken out, with dependents more than 2 but less than 3 pay additional 6.50/dependent over 2, dependents over 2 but less than 6 pay additional 5.50/dependent, and over 6 dependents pay the rate for 6 dependents.

I have been working on this for hours and the formula that I have right now is:
If(MedicalInsurance="NO",0,If(dependents>6,(\$5.50*6)+\$30,If(dependents>3,(dependents*\$5.50)+\$30,if(dependents<3,(dependents*\$6.50)+\$30,0))))

I have a feeling that I am making one little mistake but cannot figure it out.

Any help is much appreciated.

### Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
remove all \$ Sign in formulas and use it in Cell Formats

Most of those are just there to explain what I am trying to do. I have most of those numbers on a different sheet, I just didn't want to make it more confusing than it already is.

Replies
5
Views
375
Replies
1
Views
245
Replies
7
Views
437
Replies
1
Views
457
Replies
7
Views
411

Threads
1,218,499
Messages
6,142,828
Members
450,449
Latest member
Dave Carr QM

### 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

### 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