Logistics & shipping

Demurrage & Detention Calculator

Free days counted correctly, chargeable days by tier, and what is accruing right now on containers still out

Download the template — free

✓ No account, no email  ·  ✓ Excel 2016+ and Google Sheets  ·  ✓ Free for commercial use

Demurrage and detention invoices arrive after the money is already spent, which is the wrong end of the problem. The charge is arithmetic — free days, elapsed days, a rate that steps up in tiers — and all of it is knowable while the container is still out. This sheet computes the accrual as it builds, so a box approaching its free-day expiry is a decision you make on a Tuesday rather than a line item you query a month later.

What the worksheet looks like

The actual columns, with sample rows

Containers sheet: free days, chargeable days and accrued charge, all derived.
ABCDEFGHI
1ContainerTypeDischargedFree daysReturnedDays outChargeableAccrued
2MSCU7741233Demurrage2026-02-1872026-02-24600.00
3MAEU8820114Detention2026-02-2052026-03-02105475.00
4CMAU5512900Demurrage2026-03-047114340.00

The formulas that do the work

Every one of these is in the file you download

  • =IF($C5="","",IF($E5="",$K$2-$C5,$E5-$C5)) Days out. An unreturned container counts to today, so the figure is a live accrual and not a post-mortem.
  • =IF($F5="","",MAX(0,$F5-$D5)) Chargeable days. The MAX floors it at zero, so a container returned inside its free days does not produce a negative charge that quietly offsets a real one elsewhere in the column.
  • =IFERROR(INDEX(Tiers!$D$5:$D$24,MATCH(1,(Tiers!$A$5:$A$24=$B5)*(Tiers!$B$5:$B$24<=$G5)*(Tiers!$C$5:$C$24>=$G5),0)),0) Tiered rate lookup. Demurrage rarely has one price: the first days are cheap and the later ones punitive, which is the whole design of the charge.
  • =IF($G5="",0,IF($G5=0,0,$G5*$H5)) The accrued charge for this container at the applicable tier.
  • =SUMIFS(Containers!$I$5:$I$204,Containers!$E$5:$E$204,"") Total accruing right now across every container still out — the number to put in front of whoever can authorise an early return.

The 340 that had not been invoiced yet

A worked example with real numbers

Three containers discharge within a fortnight. Two are back inside their free days or close to it. The third, CMAU5512900, discharged on 4 March with seven free days, and on 15 March it is still out: eleven days out, four chargeable, 340 accrued and climbing at 85 a day. No invoice exists yet — the carrier will bill it weeks later. The sheet shows it today, while returning the box still changes the number. That is the entire point: demurrage is only expensive when you find out late.

What is in the workbook

Every tab, and what it holds

Every tab in the workbook and what it is for.
TabContents
READMEWhat to fill in and what is calculated, with the colour key.
ContainersOne row per container, 200 rows, with days out, chargeable days and accrued charge derived.
TiersThe rate table: charge type, day range and daily rate. Edit this to match your contract.
SummaryAccruing now, invoiced to date, and the worst offenders by container.

Features and related templates

What is included, and what to look at next

What it does

  • Live accrual on containers still out
  • Tiered daily rates, as contracts actually define them
  • Demurrage and detention kept apart
  • Free days floored at zero so credits cannot hide charges
  • Excel 2016+ and Google Sheets

Need it built around your own data?

  • Your own lanes, carriers and milestone names
  • Connected to your forwarder's exports
  • Delivered within 24 hours

Questions about this template

The ones that come up most

Do free days include weekends and holidays?

That depends on your contract, and the sheet counts calendar days by default because most carrier tariffs do. If yours counts working days, swap the subtraction for NETWORKDAYS — it is one formula, on the Days out column.

What is the difference between demurrage and detention here?

Demurrage is the container sitting inside the terminal past its free time; detention is the container outside the terminal, with you, past its free time. They have different rates and often different free-day allowances, which is why Type drives the tier lookup rather than being a label.

Can I model a scenario before committing?

Yes. Enter a container with a hypothetical return date and read the Accrued column. Comparing that against the cost of expediting the return is the decision the sheet exists to support.