# I still can't get this formula right(IF/AND/OR)

#### Phoebe8178

##### New Member
This is the formula that I have written in my cell, but it won't accept it. =IF(OR(AND(A4<=50000,d4<3),0.25,AND(a4<=50000,d4>3),0.0625,AND(a4>50000,a4<=300000,d4<3),0.25,AND(a4>50000,a4<=300000,d4>3),0.0625,AND(a4>300000,d4<3),0.4375,AND(a4>300000,d4>3),0.25))
I'm comparing compensation amounts with years of service and the percentage that is associated with it. I am just starting to learn all of these functions and I am getting very confused. It's probably a simple error, but I can not figure it out for the life of me. Thank you!!!!!
This message was edited by Phoebe8178 on 2002-10-08 10:28

### Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I don't think you need the OR statement

=IF(AND(A4<=50000,D4<3),0.25,IF(AND(A4<=50000,D4>3),0.0625,IF(AND(A4>50000,A4<=300000,D4<3),0.25,IF(AND(A4>50000,A4<=300000,D4>3),0.0625,IF(AND(A4>300000,D4<3),0.4375,IF(AND(A4>300000,D4>3),0.25))))))

Thank you. I will try that now.

On 2002-10-08 10:25, Phoebe8178 wrote:
This is the formula that I have written in my cell, but it won't accept it. =IF(OR(AND(A4<=50000,d4<3),0.25,AND(a4<=50000,d4>3),0.0625,AND(a4>50000,a4<=300000,d4<3),0.25,AND(a4>50000,a4<=300000,d4>3),0.0625,AND(a4>300000,d4<3),0.4375,AND(a4>300000,d4>3),0.25))
I'm comparing compensation amounts with years of service and the percentage that is associated with it. I am just starting to learn all of these functions and I am getting very confused. It's probably a simple error, but I can not figure it out for the life of me. Thank you!!!!!
This message was edited by Phoebe8178 on 2002-10-08 10:28

Consider something like

=IF(OR(AND(A4<=50000,D4<3),AND(A4>50000,A4<=300000,D4<3),AND(A4>300000,D4>3)),0.25,IF(OR(AND(A4<=50000,D4>3),AND(A4>50000,A4<=300000,D4>3)),0.0625,IF(AND(A4>300000,D4<3),0.4375,"")))

I did not check the logic or reasonableness of the formula.

1. You should check the validity of each section of the formula.
2. What if D4 =3?
This message was edited by Dave Patton on 2002-10-08 11:03

Another great suggestion, I will try both and again---THANK YOU SOOOOO MUCH!!!! These formulas can be so frustrating sometimes!

Replies
5
Views
303
Replies
6
Views
717
Replies
12
Views
687
Replies
3
Views
234
Replies
13
Views
796

1,221,009
Messages
6,157,360
Members
451,416
Latest member
Ilu

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

### Which adblocker are you using?

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

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