Excel Formula for Payout

chaharmumesh

New Member
Joined
Sep 16, 2021
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have data in which there some customer who had bought some oil in 2 different pack sizes 7.5 L and 10 L and in the Picture file attached i have given the number of bucket purchased for each pack size. Now i want to Give Payout in such a way that for Every 8 Buckets(in Multiples of 8) ,customers is given INR 6/L. The Order of buckets should be like first all the 10L buckets should be considered to give payout and then 7.5L Buckets.

for Eg.- lets say a customer has bought 10 buckets of 10 liters and 10 buckets of 7.5 liters. So total Buckets is 20.
Now as per the schemes every 8 buckets 6rs/ltr which means Payout can be give on 16 buckets because 16 is multiple of 8. Now i will consider all the 10 buckets of 10 Liters because they will contain higher volume as compared to 7.5 Liters.
Payout = (number of buckets of 10 liters * size of buckets + number of buckets of 7.5 liters * size of buckets )*6
(10*10+7.5*6)*6
 

Attachments

  • New sample.JPG
    New sample.JPG
    62.8 KB · Views: 18

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
See if this does what you want.
Copy the following formula into AF2:

VBA Code:
=IF(INT(AE2/8)<1,0,IF(AD2<(INT(AE2/8)*8),((INT(AE2/8)*8)-AD2)*7.5*6+(AD2*10*6),(INT(AE2/8)*8)*10*6))

Then drag the formula down that column.

Here is the form I used, I just didn't go out to the Ax column, in other words instead of AC, I just used C, instead of AD, I just used D, etc.

Book1
CDEFG
17.5L Buckets10L BucketsTotal BucketsPayout
2208281200
32012321620
41510251230
53710465
631114480
721012480
841115480
94370
10
Sheet3
Cell Formulas
RangeFormula
E2:E9E2= C2 + D2
F2:F9F2=IF(INT(E2/8)<1,0,IF(D2<(INT(E2/8)*8),((INT(E2/8)*8)-D2)*7.5*6+(D2*10*6),(INT(E2/8)*8)*10*6))
 
Last edited:
Upvote 0
Solution
See if this does what you want.
Copy the following formula into AF2:

VBA Code:
=IF(INT(AE2/8)<1,0,IF(AD2<(INT(AE2/8)*8),((INT(AE2/8)*8)-AD2)*7.5*6+(AD2*10*6),(INT(AE2/8)*8)*10*6))

Then drag the formula down that column.

Here is the form I used, I just didn't go out to the Ax column, in other words instead of AC, I just used C, instead of AD, I just used D, etc.

Book1
CDEFG
17.5L Buckets10L BucketsTotal BucketsPayout
2208281200
32012321620
41510251230
53710465
631114480
721012480
841115480
94370
10
Sheet3
Cell Formulas
RangeFormula
E2:E9E2= C2 + D2
F2:F9F2=IF(INT(E2/8)<1,0,IF(D2<(INT(E2/8)*8),((INT(E2/8)*8)-D2)*7.5*6+(D2*10*6),(INT(E2/8)*8)*10*6))
Thank you so much , the formula is working fine :)
 
Upvote 0
@johnnyL
I don't think that your formula needs that first IF section. In col F below I have just used the latter portion of your formula and it seems to produce the same results (& for other sample data that I tested).

@chaharmumesh
I thought that I would see if I could create a direct calculation without IF statements and came up with the col G formula below. I'm not suggesting that is is any better than the col F formula & in fact I would stick with the col F formula. However, since I was posting about that anyway, I thought that I might as well include mine too. :)

21 09 21.xlsm
CDEFG
17.5L Buckets10L BucketsTotal BucketsPayout
22082812001200
320123216201620
415102512301230
53710465465
631114480480
721012480480
841115480480
943700
Payout
Cell Formulas
RangeFormula
E2:E9E2= C2 + D2
F2:F9F2=IF(D2<(INT(E2/8)*8),((INT(E2/8)*8)-D2)*7.5*6+(D2*10*6),(INT(E2/8)*8)*10*6)
G2:G9G2=(MIN(D2,FLOOR(E2,8))*10+MAX((FLOOR(C2+MOD(D2,8),8)-MOD(D2,8))*7.5,0))*6
 
Upvote 0

Forum statistics

Threads
1,214,981
Messages
6,122,566
Members
449,089
Latest member
Motoracer88

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