SHIPPING LINE DETENTION AND DEMURRAGE CALCULATION FORMULA NEED

thanoj

New Member
Joined
Mar 17, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I need a formula to calculate the shipping line container demurrage and detention.

For Eg: I am working in a shipping line where we impor and export shipments. For import shipment my team is struggling to calculate Demurage and detention charges and we are loosing lot of money as well.

for ex -
Shipment arrived at destination port - 01/03/2021
free days for this shipment 14 days
consignee collected the container and returned it on - 25/03/2021
so basically he had the container more than 14 days.
in addition to 14 days he had kept the container extra 11 days.

for fir 5 days after free time shipping line charges USD 15
Next 5 days - USD 30
thereafter - USD 50

Since we have three line we do have three different detention rate as well.

If you can provide me the formula i can try and implement it in other line as well. thank you
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Welcome to Mr Excel forum

Maybe something like this...

Observe the table in F1:I5

Pasta1
ABCDEFGHI
1ArrivedCollectedDaysResultLowerHigherCharge $Marginal Charge $
201/03/202125/03/20212527511400
301/03/202114/03/202114015191515
401/03/202119/03/2021197520243015
501/03/202124/03/202124225255020
601/03/202126/03/202126325
Plan2
Cell Formulas
RangeFormula
C2:C6C2=B2-A2+1
D2:D6D2=SUMPRODUCT(--(C2>=F$2:F$5),C2+1-F$2:F$5,I$2:I$5)
I2:I5I2=H2-N(H1)


Hope this helps

M.
 
Upvote 0
Welcome to the Board! I have some questions:

1. How do you define a "day"...is it any partial calendar day, do weekends count, holidays? From your example, I believe any partial calendar day counts, but I wanted to clarify this. For example, 1 March to 25 March counts as 25 days, even though that spans weekends and the container may have been picked up/returned at any time during the begin/end day.

2. Are the fees described daily fees? If so, then here is another option.

Your inputs are the blue cells. Two computation methods are shown: one uses a Fee Schedule that shows how the hold-time days are apportioned among the different fee periods. The other does all of that with a single formula (cell B16). I see that my single formula suggestion is essentially the same as what @Marcelo Branco has offered above, except I hardwired the arrays for the fee period thresholds (in days) and the marginal fee rates into the SUMPRODUCT function so that a fee table is not needed.
Book5
ABCDEFGH
1
2
3Date shipment arrival at destination port3/1/2021
4Date consignee collected container
5Date consignee returned container3/25/2021
6
7Days consignee held container25
8Total hold-time fee (USD)275
9
10Fee Schedule:Fee PeriodsDays in fee periodFee/day (USD)Days >Days <=Hold time apportioned (days)Fee period
110140014140
1215151419575
13253019245150
14399999995024150
15
16Total hold-time fee (USD) (single formula)275
Sheet1
Cell Formulas
RangeFormula
B7B7=B5-B3+1
B8B8=SUM(H11:H14)
G11:G14G11=MIN(C11,$B$7-SUM(G$10:G10))
H11:H14H11=G11*D11
F11:F13F11=E11+C11
E12:E14E12=F11
B16B16=SUMPRODUCT(--(B7>={0;14;19;24}),(B7-{0;14;19;24}),{0;15;15;20})
 
Last edited:
Upvote 0
DEMURRAGE TEST.PNG
 
Upvote 0
Hi Dear Team,

I Hope everything are well at moment.

Can i have your support on demurrage amount calculation above.

Column H: Are the numbers of days that shipping line needs to charges.

Column I, J and K: Are the rates by the Shipping line.

On line 2 my charges will be between H and I.
On line 3 my charges will be between H, I and J.
On line 4 my charges will be between H, I, J and K
 
Upvote 0
Here is one approach. You'll see that I added helper columns and row (shaded yellow) so that some arrays can be easily formed to make the calculation easier using the SUMPRODUCT formula. Those helper columns and top row can be hidden from view so that your table will have the same appearance as what you originally posted. The "Baseline" column is used when forming an array of the marginal demurrage rates, which is necessary when using this approach.
MrExcel_20220309_Adriano Diogo.xlsx
ABCDEFGHIJKLMN
1threshold days over ->0143045
2Shipping LineContainer SizeContainer NumberArrival DateFree DaysDemurrage Start DateDeliver Container DateDays of DemurrageBaseline1-14 Days15-30 Days31-45 Days45> DaysDemurrage Amount
3NileDutch20 FTTCKU353226611/25/20213012/25/20211/21/202226$0.00$0.00$50.00$100.00$150.00$600.00
4UAL40 FTTCKU435044011/5/20211511/20/20211/2/202242$0.00$0.00$50.00$100.00$150.00$2,000.00
5MSC40 FT Open TopMSCU573399010/8/20214511/22/20211/22/202260$0.00$0.00$50.00$100.00$150.00$4,550.00
Diogo
Cell Formulas
RangeFormula
H3:H5H3=G3-F3-1
I3:I5I3=J3
F3:F5F3=D3+E3
N3:N5N3=SUMPRODUCT(--(H3>$J$1:$M$1),(H3-$J$1:$M$1),J3:M3-I3:L3)
 
Upvote 0
I was curious about taking an alternative approach, where instead of forming an array of marginal demurrage rates (see post #6), an array is created showing how many "days of demurrage" are apportioned to each demurrage rate bin. If you are using Excel 365, the formula can be shortened somewhat using the LET function. This example still relies on a helper row at top and a column for the first rate bin (which is $0 for the first 14 days). Those helper cells are shaded yellow and can be hidden from view if desired. Note that the top helper row requires the addition of a large number that will always exceed the largest anticipated "Days of Demurrage" (I used 9999). The apportionment of days is created by the LET function. Taking row 4 as an example, where 42 days of demurrage are shown, these days are apportioned {14,16,12,0} by the LET function, and then multiplied by the demurrage rates {$0, $50, $100, $150} and summed (by the SUMPRODUCT function) to give $2000.
MrExcel_20220309_Adriano Diogo.xlsx
ABCDEFGHIJKLM
1threshold days over ->01430459999
2Shipping LineContainer SizeContainer NumberArrival DateFree DaysDemurrage Start DateDeliver Container DateDays of Demurrage1-14 Days15-30 Days31-45 Days45> DaysDemurrage Amount
3NileDutch20 FTTCKU353226611/25/20213012/25/20211/21/202226$0.00$50.00$100.00$150.00$600.00
4UAL40 FTTCKU435044011/5/20211511/20/20211/2/202242$0.00$50.00$100.00$150.00$2,000.00
5MSC40 FT Open TopMSCU573399010/8/20214511/22/20211/22/202260$0.00$50.00$100.00$150.00$4,550.00
Diogo2
Cell Formulas
RangeFormula
F3:F5F3=D3+E3
H3:H5H3=G3-F3-1
M3:M5M3=SUMPRODUCT(I3:L3,LET(appdays,IF(J$1:M$1<=H3,J$1:M$1-I$1:L$1,H3-I$1:L$1),(appdays>0)*appdays))
 
Upvote 0
Hi Kirk,

Excellent, marvelous topics.

I have some question on H3.
The total amount of demurrage cost should be $1300 instead of $600.
H3 still in range of column J2 because we had only 26 days of demurrage.
We didn't exceed a 30 Days cannot be charged out of J2.

Cheers,
Adriano Diogo
 
Upvote 0
I have some question on H3.
The total amount of demurrage cost should be $1300 instead of $600.
H3 still in range of column J2 because we had only 26 days of demurrage.
We didn't exceed a 30 Days cannot be charged out of J2.

Cheers,
Adriano Diogo

Hi,

I'm confused, if H3 result should be 1300 instead of 600, why does your I1 say 15-30 Days ?
What about H4:H5, what are the expected results for those ?
 
Upvote 0
Hi Adriano, I'm confused for the same reason described by @jtakw. In post #4, you have column headings in I1:K1 that appear to describe the day ranges during which certain demurrage rates apply. What rate applies for days 1-14? In my example, I assumed $0/day for days 1-14.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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