Allocate rebates formula

Titian

Well-known Member
Joined
Dec 17, 2004
Messages
567
The number of transactions is scaled down to provide this example.

Rebate scheme (Cum Sales = Cumulative sales) based on the total turnover of a group of customers.

Cum Sales....Rate....Sales Band...Rebate
20,000........1.0%.......20,000........200
35,000........2.0%.......15,000........300
45,000........2.5%.........3,400.........85
...................Total......38,400.......585 average rebate 1.5%

I would like to correctly allocate the £585 rebate across the individual customers who have generated the turnover i.e. NOT by using the simple 1.5%.

Clearly the large sales value customers will have earned a higher % rebate than the lower sales value customers - but how to calculate?

Customer....Sales value...Rebate
A...................15,000
B.......................900
C....................7,000
D....................3,000
E.......................500
F.....................9,000
G.....................2,000
H.....................1,000
Total...............38,400.........585

Your help is appreciaated.
 
Ah! yes I see.

I can see how someone may become fixated playing fruit machines, just watching the numbers fly round as the macro executes on this test dataset is "exciting".

I know that I can suspend screen output to speed up the program. Do you have anything else in mind to increase the speed?

Thanks.
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
The only way (apart from stopping screenupdating) is to reduce the number of iterations. Based on your actual data, you might:

* increase the number to add from 1 to something larger
* start off with a minimum value (instead of from 0, in the test example 500 would best)
* paste the number to add to all rows at once using pastespecial instead of looping through all rows

All the above requires checks to make sure that the numbers don't overflow, which makes things a more complicated.

It feels like there instead of making large amounts of code should be some easier solution. Maybe someone else has a better approach?
 
Upvote 0

Forum statistics

Threads
1,216,169
Messages
6,129,272
Members
449,497
Latest member
The Wamp

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