calculating how many days to pay for stock within single month based on stock age

Mehow

New Member
Joined
Feb 23, 2018
Messages
15
So this might seem complicated from the topic name - but i think it's rather simple and i'm just stuck on this one

1658927837541.png


The green part is what it should look like and grey is empty of any formulas

We have a stock in row 5 - the stock is 44 days old -> the stock left the depo on 2nd day of the month which means that there is a 1 day payment for this month.
The way this works -> first 21 days are FOC(Free of charge) and after that there are ranges of stock age for which they pay

So if the stock was 44 Days old at the moment it left depo - they pay according to column W = the stock was between 31-45 days old
And if the stock was 32 days old (line 12) and there is 12 days to pay - 8 days fall into 22-30 days and 4 days fall into 31-45 days

How can i calculate that automatically that the stock age falls into the right categories?
 

Attachments

  • 1658926737865.png
    1658926737865.png
    14.7 KB · Views: 5
  • 1658926838850.png
    1658926838850.png
    21.4 KB · Views: 6
  • 1658927764160.png
    1658927764160.png
    19.1 KB · Views: 6

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
*Can't edit the post for some reason but the attachments in the Original post can be ignored - just the pictrure inside the post is relevant*
 
Upvote 0
Here is a better example using Xl2bb

KWC 21 days wersja dobra.xls
ABCDEFGHIJK
1Day of produtionFirst day of month OR the first day the product reached 21 daysLast day of month OR the day customer picked upDays that need to be paid forThis needs to show the amount of days that the stock spent in these buckets - based on calculated storage time
2Invoiced Customer CodeInvoiced CustomerStart of StorageStart of CalculationEnd of CalculationCalculated Storage TimeStockAge0-21 days Free Of Charge22-30 days31-45 days46+ days
3
4
5110014.19.20226.1.20226.2.20221440010
6210023.6.20226.1.20226.30.20223011600030
7310034.7.20226.1.20226.7.20226610006
8310035.29.20226.19.20226.30.202212320290
9310034.16.20226.1.20226.10.20229550009
10310034.17.20226.1.20226.17.20221661
11310034.11.20226.1.20226.6.2022556
12310034.11.20226.1.20226.10.2022960
13310034.11.20226.1.20226.9.2022859
14310034.11.20226.1.20226.10.2022960
15310034.11.20226.1.20226.6.2022556
16310034.11.20226.1.20226.9.2022859
17310034.13.20226.1.20226.10.2022958
18310034.14.20226.1.20226.17.20221664
19310034.18.20226.1.20226.17.20221660
20310034.14.20226.1.20226.17.20221664
21310034.15.20226.1.20226.10.2022956
22310034.22.20226.1.20226.17.20221656
23310034.22.20226.1.20226.17.20221656
24310034.15.20226.1.20226.10.2022956
test sheet
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
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