Hi
I'm trying to create the following formula for a sliding retention calculation based on an invoice amount as follows:-
1. If the current amount invoiced is less than $200,000 retention value is 10%
2. If the current amount invoiced is between $200,000 and $800,000 the retention value is $200,000 @ 10% and the balance at 5%
3. If the current amount invoiced is over $800,000 the retention value is $200,000 @ 10% and $600,000 5% and the balance at 2%
For example
[TABLE="width: 285"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD][/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD]Invoice Amount[/TD]
[TD]$900,000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]
[TD]$200,000[/TD]
[TD]10%[/TD]
[TD]$20,000[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]
[TD]$800,000[/TD]
[TD]5%[/TD]
[TD]$30,000[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]
[TD]$800,000[/TD]
[TD]2%[/TD]
[TD]$2,000[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD]Retention[/TD]
[TD]Total[/TD]
[TD]$52,000[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD]Formula Answer[/TD]
[TD][/TD]
[TD]$57,000[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[TD]IF((C2)<=B4,C2*C4,IF(AND((C2)>B4,(C2)<=B5),(B4*C4)+(C2-B4)*C5,IF((C2)>B6,((B4*C4)+((C2-B4)*C5)+(C2-B6)*C6))))
Formula above is sort of there works for anything under $800,000 but over $800,000 doesn't give the right answer
Any Help much appreciated
Thanks
[/TD]
[/TR]
</tbody>[/TABLE]
I'm trying to create the following formula for a sliding retention calculation based on an invoice amount as follows:-
1. If the current amount invoiced is less than $200,000 retention value is 10%
2. If the current amount invoiced is between $200,000 and $800,000 the retention value is $200,000 @ 10% and the balance at 5%
3. If the current amount invoiced is over $800,000 the retention value is $200,000 @ 10% and $600,000 5% and the balance at 2%
For example
[TABLE="width: 285"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD][/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD]Invoice Amount[/TD]
[TD]$900,000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]
<
[/TD][TD]$200,000[/TD]
[TD]10%[/TD]
[TD]$20,000[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]
>$200,000 but <$800,000
[/TD][TD]$800,000[/TD]
[TD]5%[/TD]
[TD]$30,000[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]
>
[/TD][TD]$800,000[/TD]
[TD]2%[/TD]
[TD]$2,000[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD]Retention[/TD]
[TD]Total[/TD]
[TD]$52,000[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD]Formula Answer[/TD]
[TD][/TD]
[TD]$57,000[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[TD]IF((C2)<=B4,C2*C4,IF(AND((C2)>B4,(C2)<=B5),(B4*C4)+(C2-B4)*C5,IF((C2)>B6,((B4*C4)+((C2-B4)*C5)+(C2-B6)*C6))))
Formula above is sort of there works for anything under $800,000 but over $800,000 doesn't give the right answer
Any Help much appreciated
Thanks
[/TD]
[/TR]
</tbody>[/TABLE]