Cassidy7782
New member
- Local time
- Today, 07:08
- Joined
- Nov 2, 2018
- Messages
- 6
Hello all,
I am currently running MS Access 2010 and am having major issues with my multiple if statements. Basically, I have a working set of multiple IIf's and need to have a second set of IIf's based on the value in another field. I did a little research and select may be more applicable but not sure how it works. My current working code is...
=IIf([Gross wages]-(345.8*[Deductions]) Between 308 And 1102,([Gross wages]-((345.8*[Deductions])-308))*0.1,IIf([Gross wages]-(345.8*[Deductions]) Between 1103 And 3533,((([Gross wages]-(345.8*[Deductions]))-1102)*0.12)+79.4,IIf([Gross wages]-(345.8*[Deductions]) Between 3534 And 7183,((([Gross wages]-(345.8*[Deductions]))-3533)*0.22)+371.12,IIf([Gross wages]-(345.8*[Deductions]) Between 7184 And 13433,((([Gross wages]-(345.8*[Deductions]))-7183)*0.24)+1174.12,IIf([Gross wages]-(345.8*[Deductions]) Between 13434 And 16975,((([Gross wages]-(345.8*[Deductions]))-13433)*0.32)+2674.12,IIf([Gross wages]-(345.8*[Deductions]) Between 16975 And 41975,((([Gross wages]-(345.8*[Deductions]))-16975)*0.35)+3807.56,0))))))
And now I need the two different variations of IIf together.
=IIf([Federal Filing Status]=1,([Gross wages]-(345.8*[Deductions]) Between 308 And 1102,((([Gross wages]-(345.8*[Deductions]))-308)*0.1),IIf([Gross wages]-(345.8*[Deductions]) Between 1103 And 3533,((([Gross wages]-(345.8*[Deductions]))-1102)*0.12)+79.4,IIf([Gross wages]-(345.8*[Deductions]) Between 3534 And 7183,((([Gross wages]-(345.8*[Deductions]))-3533)*0.22)+371.12,IIf([Gross wages]-(345.8*[Deductions]) Between 7184 And 13433,((([Gross wages]-(345.8*[Deductions]))-7183)*0.24)+1174.12,IIf([Gross wages]-(345.8*[Deductions]) Between 13434 And 16975,((([Gross wages]-(345.8*[Deductions]))-13433)*0.32)+2674.12,IIf([Gross wages]-(345.8*[Deductions]) Between 16975 And 41975,((([Gross wages]-(345.8*[Deductions]))-16975)*0.35)+3807.56,0))))))
IIf([Federal Filing Status]=2,([Gross wages]-(345.8*[Deductions]) Between 963 And 2550,([Gross wages]-((345.8*[Deductions])-963))*0.1,IIf([Gross wages]-(345.8*[Deductions]) Between 2550 And 7413,((([Gross wages]-(345.8*[Deductions]))-2550)*0.12)+158.7,IIf([Gross wages]-(345.8*[Deductions]) Between 7413 And 14713,((([Gross wages]-(345.8*[Deductions]))-7413)*0.22)+371.12,IIf([Gross wages]-(345.8*[Deductions]) Between 14713 And 27213,((([Gross wages]-(345.8*[Deductions]))-14713)*0.24)+2348.26,IIf([Gross wages]-(345.8*[Deductions]) Between 27213 And 34296,((([Gross wages]-(345.8*[Deductions]))-27213)*0.32)+5348.26,IIf([Gross wages]-(345.8*[Deductions]) Between 34296 And 50963,((([Gross wages]-(345.8*[Deductions]))-34296)*0.35)+7614.82,0)))))))))))))
I am currently running MS Access 2010 and am having major issues with my multiple if statements. Basically, I have a working set of multiple IIf's and need to have a second set of IIf's based on the value in another field. I did a little research and select may be more applicable but not sure how it works. My current working code is...
=IIf([Gross wages]-(345.8*[Deductions]) Between 308 And 1102,([Gross wages]-((345.8*[Deductions])-308))*0.1,IIf([Gross wages]-(345.8*[Deductions]) Between 1103 And 3533,((([Gross wages]-(345.8*[Deductions]))-1102)*0.12)+79.4,IIf([Gross wages]-(345.8*[Deductions]) Between 3534 And 7183,((([Gross wages]-(345.8*[Deductions]))-3533)*0.22)+371.12,IIf([Gross wages]-(345.8*[Deductions]) Between 7184 And 13433,((([Gross wages]-(345.8*[Deductions]))-7183)*0.24)+1174.12,IIf([Gross wages]-(345.8*[Deductions]) Between 13434 And 16975,((([Gross wages]-(345.8*[Deductions]))-13433)*0.32)+2674.12,IIf([Gross wages]-(345.8*[Deductions]) Between 16975 And 41975,((([Gross wages]-(345.8*[Deductions]))-16975)*0.35)+3807.56,0))))))
And now I need the two different variations of IIf together.
=IIf([Federal Filing Status]=1,([Gross wages]-(345.8*[Deductions]) Between 308 And 1102,((([Gross wages]-(345.8*[Deductions]))-308)*0.1),IIf([Gross wages]-(345.8*[Deductions]) Between 1103 And 3533,((([Gross wages]-(345.8*[Deductions]))-1102)*0.12)+79.4,IIf([Gross wages]-(345.8*[Deductions]) Between 3534 And 7183,((([Gross wages]-(345.8*[Deductions]))-3533)*0.22)+371.12,IIf([Gross wages]-(345.8*[Deductions]) Between 7184 And 13433,((([Gross wages]-(345.8*[Deductions]))-7183)*0.24)+1174.12,IIf([Gross wages]-(345.8*[Deductions]) Between 13434 And 16975,((([Gross wages]-(345.8*[Deductions]))-13433)*0.32)+2674.12,IIf([Gross wages]-(345.8*[Deductions]) Between 16975 And 41975,((([Gross wages]-(345.8*[Deductions]))-16975)*0.35)+3807.56,0))))))
IIf([Federal Filing Status]=2,([Gross wages]-(345.8*[Deductions]) Between 963 And 2550,([Gross wages]-((345.8*[Deductions])-963))*0.1,IIf([Gross wages]-(345.8*[Deductions]) Between 2550 And 7413,((([Gross wages]-(345.8*[Deductions]))-2550)*0.12)+158.7,IIf([Gross wages]-(345.8*[Deductions]) Between 7413 And 14713,((([Gross wages]-(345.8*[Deductions]))-7413)*0.22)+371.12,IIf([Gross wages]-(345.8*[Deductions]) Between 14713 And 27213,((([Gross wages]-(345.8*[Deductions]))-14713)*0.24)+2348.26,IIf([Gross wages]-(345.8*[Deductions]) Between 27213 And 34296,((([Gross wages]-(345.8*[Deductions]))-27213)*0.32)+5348.26,IIf([Gross wages]-(345.8*[Deductions]) Between 34296 And 50963,((([Gross wages]-(345.8*[Deductions]))-34296)*0.35)+7614.82,0)))))))))))))