Bonus logic question

drbro

New Member
Joined
May 15, 2021
Messages
8
Office Version
  1. 2019
Platform
  1. Windows
I have a system which based on what a user spent within a day they get bonus cash back. In essence for each $500 spent they get a $25 in a bonus wallet. If the amount is simple for example $1000 then its easy and we give $50. The problem arises if the user spent on visit A $400 whereas they get nothing. but on visit B they spent $600 which between those 2 visits they spent $1000 and considering that they did not get a bonus on visit A they should get $50 (2*25) on visit B. Keep in mind that the user can spend what ever they earn on their bonus wallet whenever they want within the day. I have attached my screenshot where I would like to find a way to programmatically do this calculation regarding the bonus. Any help is much appreciated.
 

Attachments

  • 8AKP8hB.png
    8AKP8hB.png
    25.6 KB · Views: 20

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I think you would need macro code to do what you are asking. That, or at least a 'helper' additional cell to keep track of $ spent thus far that don't qualify for the 'bonus'.

On a side note, if those transactions are made on a card, it is probably stolen, who spends that much money in one day? :)

You also didn't mention if the customer uses their 'bonus' money, is that considered $ spent? Kind of like if you get paid for a holiday and those (free) hours put you into overtime, most companies will not pay you for the overtime that those (free) hours caused.

You also have some miscalculations in your picture. For example first transaction is @ 10:00 AM, second transaction is listed @ 12:00 AM <-- that should be PM if what you have are the transactions for one day. The next incidence I saw was the 'Total bonus in bonus wallet before' column is not being adjusted when the customer spends money from that wallet. The 'Total bonus in bonus wallet after' seems correct though.
 
Upvote 0
Scratch that, the last column is not correct either, well at least the first entry anyway.

The last cell in the 'bonus' column is not correct either.
 
Last edited:
Upvote 0
This should solve everything I mentioned, leaving just the 'bonus' column to be calculated via formula or macro:

drbro1.xlsx
ABCDEFG
1timeTransaction AmountTotal $ Spent Todaybonus earnedTotal bonus in wallet beforeBonus spentTotal bonus remaining
210:00 AM5005002525050
312:00 PM50010002550075
41:00 PM10002000507510025
52:00 PM50025002525050
65:00 PM20004500100500150
76:00 PM400490001500150
87:00 PM60055005015017525
98:00 PM100065005025075
109:00 PM1200770050750125
1110:00 PM80085005012512550
Sheet1
Cell Formulas
RangeFormula
C2C2= B2
C3:C11C3= C2 + B3
E3:E11E3= G2
G2:G11G2= D2 + E2 - F2
 
Upvote 0
Hi & welcome to MrExcel.
Is this what you want?
+Fluff 1.xlsm
ABCDEFG
1timeMoney SpentTotal money spentBonusTotal bonus in wallet beforeBonus spentTotal bonus remaining
210:00:005005002525025
312:00:0050010002550050
413:00:0010002000501001000
514:00:00500250025125025
617:00:00200045001002250125
718:00:00400490002250125
819:00:006005500502751750
920:00:001000650050325050
1021:00:0012007700503750100
1122:00:0080085005042512525
12
Main
Cell Formulas
RangeFormula
C2:C11,E2:E11C2=SUM(B$2:B2)
D2:D11D2=INT(C2/500)*25-N(SUM(D$1:D1))
G2:G11G2=E2-SUM(F$2:F2)
 
Upvote 0
Solution
Hi, apologies as I was a bit sick. I am more interested in the bonus calculation. That is column D and especially looking at column B and row 7 and 8. The issue here is that every $500 we give $25 but if on one session the user spends 400 they get nothing but on the next session they spent 600 which is total 1000 - we want to give them 2x$25. We want an intelligent way to calculate this. Right now is quite simplistic as it only looks on the amount per session.
 
Upvote 0
That's exactly what the formula I suggested does.
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,049
Members
449,206
Latest member
Healthydogs

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