If Statement Calculations

DShack

Board Regular
Joined
Jan 15, 2014
Messages
64
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hello All,

I am trying to build a If formula that will calculate fees based off percentages. Below is monthly revenue generated by different lines of business. If the sum of the months are less than a 1 million dollars than the monthly revenue gets calculated at 7%. Once the revenue goes above 1 million dollars than it gets calculated at 5%. As you can see below my numbers go negative. If you take line 5 (348300) for instance. The first month gets calced at 7%, the same with Feb however in March 44900 of the 348300 is over 1 Million so the 44900 gets calced at 5% and the 303400 gets calced at 7%. My current formula works for the first couple months but fails me towards the end of the year.

Here is what i have:

[TABLE="width: 907"]
<tbody>[TR]
[TD="class: xl67, width: 93"]Jan '18[/TD]
[TD="class: xl67, width: 74"]Feb '18[/TD]
[TD="class: xl67, width: 74"]Mar '18[/TD]
[TD="class: xl67, width: 74"]Apr '18[/TD]
[TD="class: xl67, width: 74"]May '18[/TD]
[TD="class: xl67, width: 74"]Jun '18[/TD]
[TD="class: xl67, width: 74"]Jul '18 [/TD]
[TD="class: xl67, width: 74"]Aug '18[/TD]
[TD="class: xl67, width: 74"]Sept '18 [/TD]
[TD="class: xl67, width: 74"]Oct '18[/TD]
[TD="class: xl67, width: 74"]Nov '18[/TD]
[TD="class: xl68, width: 74"]Dec '18[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 907"]
<colgroup><col><col span="11"></colgroup><tbody>[TR]
[TD] 201,575[/TD]
[TD] 201,575[/TD]
[TD] 201,575[/TD]
[TD] 195,689[/TD]
[TD] 204,584[/TD]
[TD] 204,584[/TD]
[TD] 195,689[/TD]
[TD] 192,131[/TD]
[TD] 201,575[/TD]
[TD] 201,575[/TD]
[TD] 201,575[/TD]
[TD] 201,575[/TD]
[/TR]
[TR]
[TD] 144,344[/TD]
[TD] 144,344[/TD]
[TD] 144,344[/TD]
[TD] 140,129[/TD]
[TD] 146,498[/TD]
[TD] 146,498[/TD]
[TD] 140,129[/TD]
[TD] 137,581[/TD]
[TD] 144,344[/TD]
[TD] 144,344[/TD]
[TD] 144,344[/TD]
[TD] 144,344[/TD]
[/TR]
[TR]
[TD] 108,847[/TD]
[TD] 108,847[/TD]
[TD] 108,847[/TD]
[TD] 105,669[/TD]
[TD] 110,472[/TD]
[TD] 110,472[/TD]
[TD] 105,669[/TD]
[TD] 103,748[/TD]
[TD] 108,847[/TD]
[TD] 108,847[/TD]
[TD] 108,847[/TD]
[TD] 108,847[/TD]
[/TR]
[TR]
[TD] 163,741[/TD]
[TD] 163,741[/TD]
[TD] 163,741[/TD]
[TD] 158,960[/TD]
[TD] 166,185[/TD]
[TD] 166,185[/TD]
[TD] 158,960[/TD]
[TD] 156,070[/TD]
[TD] 163,741[/TD]
[TD] 163,741[/TD]
[TD] 163,741[/TD]
[TD] 163,741[/TD]
[/TR]
[TR]
[TD] 348,300[/TD]
[TD] 348,300[/TD]
[TD] 348,300[/TD]
[TD] 338,129[/TD]
[TD] 353,499[/TD]
[TD] 353,499[/TD]
[TD] 338,129[/TD]
[TD] 331,981[/TD]
[TD] 348,300[/TD]
[TD] 348,300[/TD]
[TD] 348,300[/TD]
[TD] 348,300[/TD]
[/TR]
[TR]
[TD] 133,833[/TD]
[TD] 133,833[/TD]
[TD] 133,833[/TD]
[TD] 129,925[/TD]
[TD] 135,831[/TD]
[TD] 135,831[/TD]
[TD] 129,925[/TD]
[TD] 127,563[/TD]
[TD] 133,833[/TD]
[TD] 133,833[/TD]
[TD] 133,833[/TD]
[TD] 133,833[/TD]
[/TR]
</tbody>[/TABLE]


This is my current formula with its out put.
These amounts are in data cells for reference: 7%, 5%, 1,000,000
=IF(SUM(Frachisee!$D4:J4)>Revenue!$F$167,((SUM(Frachisee!$D4:J4)-1000000)*$E$167)+((Frachisee!J4-((SUM(Frachisee!$D4:J4))-1000000))*Revenue!$D$167),Frachisee!J4*Revenue!$D$167)


[TABLE="width: 941"]
<colgroup><col><col><col span="10"></colgroup><tbody>[TR]
[TD] 14,110[/TD]
[TD] 14,110[/TD]
[TD] 14,110[/TD]
[TD] 13,698[/TD]
[TD] 14,221[/TD]
[TD] 10,129[/TD]
[TD] 5,593[/TD]
[TD] 1,501[/TD]
[TD] (1,869)[/TD]
[TD] (5,901)[/TD]
[TD] (9,932)[/TD]
[TD] (13,964)[/TD]
[/TR]
[TR]
[TD] 10,104[/TD]
[TD] 10,104[/TD]
[TD] 10,104[/TD]
[TD] 9,809[/TD]
[TD] 10,255[/TD]
[TD] 10,255[/TD]
[TD] 9,683[/TD]
[TD] 6,753[/TD]
[TD] 4,340[/TD]
[TD] 1,453[/TD]
[TD] (1,434)[/TD]
[TD] (4,321)[/TD]
[/TR]
[TR]
[TD] 7,619[/TD]
[TD] 7,619[/TD]
[TD] 7,619[/TD]
[TD] 7,397[/TD]
[TD] 7,733[/TD]
[TD] 7,733[/TD]
[TD] 7,397[/TD]
[TD] 7,262[/TD]
[TD] 7,619[/TD]
[TD] 6,014[/TD]
[TD] 3,837[/TD]
[TD] 1,660[/TD]
[/TR]
[TR]
[TD] 11,462[/TD]
[TD] 11,462[/TD]
[TD] 11,462[/TD]
[TD] 11,127[/TD]
[TD] 11,633[/TD]
[TD] 11,633[/TD]
[TD] 8,297[/TD]
[TD] 4,973[/TD]
[TD] 2,235[/TD]
[TD] (1,039)[/TD]
[TD] (4,314)[/TD]
[TD] (7,589)[/TD]
[/TR]
[TR]
[TD] 24,381[/TD]
[TD] 24,381[/TD]
[TD] 23,483[/TD]
[TD] 16,008[/TD]
[TD] 10,014[/TD]
[TD] 2,944[/TD]
[TD] (4,894)[/TD]
[TD] (11,964)[/TD]
[TD] (17,788)[/TD]
[TD] (24,754)[/TD]
[TD] (31,720)[/TD]
[TD] (38,686)[/TD]
[/TR]
[TR]
[TD] 9,368[/TD]
[TD] 9,368[/TD]
[TD] 9,368[/TD]
[TD] 9,095[/TD]
[TD] 9,508[/TD]
[TD] 9,508[/TD]
[TD] 9,095[/TD]
[TD] 7,718[/TD]
[TD] 5,480[/TD]
[TD] 2,803[/TD]
[TD] 127[/TD]
[TD] (2,550)[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
A8: =Rate1*A6+(Rate2-Rate1)*MEDIAN(A6,0,SUM($A6:A6)-Threshold)


Excel 2010
ABCDEFGHIJKL
1Rate17%
2Rate25%
3Threshold1,000,000
4
5Jan '18Feb '18Mar '18Apr '18May '18Jun '18Jul '18Aug '18Sept '18Oct '18Nov '18Dec '18
6201,575201,575201,575195,689204,584204,584195,689192,131201,575201,575201,575201,575
7
814,11014,11014,11013,69814,22110,2299,7849,60710,07910,07910,07910,079
Sheet1
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,052
Members
452,542
Latest member
Bricklin

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

Which adblocker are you using?

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
Back
Top