"Due to contraints, a vlookup will not work
Last problem -whenever the subtotal is different when I am multiplying by 0.05 ( in my first if statement),the calculation is wrong for max discount, EXCEPT WHEN MY SECOND IF STATEMENT IS CALCULATED THE MAX DISCOUNT IS CORRECT
=IF(OR(E9="A",E9="B",E9="CB",E9="K",E9="L",E9="M",E9="N",E9="Q",E9="R",E9="W",E9="Y"),(I9*0.05),0) +
IF(OR(E9="MD",E9="WG"),(I9*0.03),0) +
IF(AND(F2<401,E9="D"),50,IF(AND(F2>400,F5<501,E9="D"),100,IF(AND(F2>500,F5<1001,E9="D"),150,IF(AND(F2>1000,E9="D"),300,0))))+
IF(AND(F2<401,E9="H"),50,IF(AND(F2>400,F5<501,E9="H"),100,IF(AND(F2>500,F5<1001,E9="H"),150,IF(AND(F2>1000,E9="H"),300,0)))) +
IF(AND(F2<401,E9="V"),50,IF(AND(F2>400,F5<501,E9="V"),100,IF(AND(F2>500,F5<1001,E9="V"),150,IF(AND(F2>1000,E9="V"),300,0)))) +
IF(AND(F2<401,E9="T"),50,IF(AND(F2>400,F5<501,E9="T"),100,IF(AND(F2>500,F5<1001,E9="T"),150,IF(AND(F2>1000,E9="T"),300,0)))) +
IF(AND(F2<401,E9="X"),50,IF(AND(F2>400,F5<501,E9="X"),100,IF(AND(F2>500,F5<1001,E9="X"),150,IF(AND(F2>1000,E9="X"),300,0))))
[TABLE="width: 763"]
<colgroup><col><col><col><col span="2"><col></colgroup><tbody>[TR]
[TD]Company [/TD]
[TD]aaaaa[/TD]
[TD]bbbb[/TD]
[TD]ccccc[/TD]
[TD]Subtotal[/TD]
[TD]Max Discount[/TD]
[/TR]
[TR]
[TD]CB[/TD]
[TD] $ 1.00[/TD]
[TD]10%[/TD]
[TD] $ 10.00[/TD]
[TD] $ 560.00[/TD]
[TD] $ 28.50[/TD]
[/TR]
[TR]
[TD]L[/TD]
[TD] $ 1.00[/TD]
[TD]10%[/TD]
[TD] $ 10.00[/TD]
[TD] $ 560.00[/TD]
[TD] $ 28.50[/TD]
[/TR]
[TR]
[TD]N[/TD]
[TD] $ 1.00[/TD]
[TD]10%[/TD]
[TD] $ 10.00[/TD]
[TD] $ 560.00[/TD]
[TD] $ 28.50[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD] $ 1.00[/TD]
[TD]12%[/TD]
[TD] $ 10.00[/TD]
[TD] $ 570.00[/TD]
[TD] $ 28.50[/TD]
[/TR]
</tbody>[/TABLE]