How to calculate a late fee based on days overdue in Excel
Formula (Excel and Google Sheets)
=IF(C2>B2,MIN($G$2,(C2-B2)*$G$1),0)Charge the daily fee for each day late, up to a cap: =IF(C2>B2,MIN($G$2,(C2-B2)*$G$1),0).
- Result on the example
- one result per row in
D2, filled down toD6 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in D2, filled down to D6. Change any input and the result updates, or edit the formula to experiment.
How it works
Subtracting the due date from the return date gives the days late. When that is positive, the fee is days × daily fee, and MIN keeps it at or below the cap: R-4 is 13 days late, which would be 32.50, so it is charged 20.
=IF(C2>B2,MIN($G$2,(C2-B2)*$G$1),0)Result0
C210/9/2026The value in C2.
B210/10/2026The value in B2.
C2>B2FALSEThe > operator tests greater than.
$G$2$20.00The value in G2.
C2-B2-1The - operator subtracts.
$G$1$2.50The value in G1.
C2-B2)*$G$1-2.5The * operator multiplies.
MIN($G$2,(C2-B2)*$G$1)-2.5not usedMIN: Smallest number.- number1
$G$2$20.00 - number2
C2-B2)*$G$1-2.5
- number1
IF(C2>B2,MIN($G$2,(C2-B2)*$G$1),0)0IF: Returns one value if a test is true, another if false.- logical_test
C2>B2FALSE - value_if_true
MIN($G$2,(C2-B2)*$G$1)-2.5not used - value_if_false
0
- logical_test
In Google Sheets
The same formula works in Google Sheets: =IF(C2>B2,MIN($G$2,(C2-B2)*$G$1),0). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =MIN($G$2,MAX(0,C2-B2)*$G$1) | $0.00, $7.50, $0.00… | No IF: MAX(0,…) turns early returns into 0 days, and MIN applies the cap. |
| =IF(C2>B2,(C2-B2)*$G$1,0) | $0.00, $7.50, $0.00…Different result | Without a cap. R-4 is charged 32.50 instead of the 20 maximum. |
Common mistakes
- Items not yet returned have no return date and show 0. Charge them up to today with
IF(C2="",TODAY(),C2)in place of C2. - Format the fee column as currency. If it picks up a date format from the date columns, 7.5 shows as a date.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Calculate a late fee based on days overdue
D2, charge the fee in G1 for each day the item came back late, capped at the maximum in G2, and 0 when it wasn't late. Fill down to D6.Questions
How do I allow a 2-day grace period?
Subtract it from the days late: =MIN($G$2,MAX(0,C2-B2-2)*$G$1).
How do I count only working days late?
Use NETWORKDAYS: =MAX(0,NETWORKDAYS(B2,C2)-1)*$G$1.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.