Insurers in the US state of Georgia use something called the 17c formula to put a number on diminished value: how much less a car is worth after an accident, even when the repair is perfect. I implemented it for a small calculator and expected ten minutes of work. The formula really is three multiplications. The parts worth writing about are the edges.

The formula

The worksheet that goes with the formula has three steps:

  1. Base loss of value: 10% of the car's value before the accident.
  2. Multiply by a damage modifier from 0 to 1.
  3. Multiply by a mileage modifier from 0 to 1.
const BASE_LOSS_RATE = 0.1; const clamp01 = (n: number) => Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 0; function formula17c(preLossValue: number, damage: number, mileage: number) { const value = Number.isFinite(preLossValue) && preLossValue > 0 ? preLossValue : 0; const baseLoss = value * BASE_LOSS_RATE; const afterDamage = baseLoss * clamp01(damage); return afterDamage * clamp01(mileage); } 

A $30,000 car with moderate damage (0.5) and 45,000 miles (0.6): 30,000 x 0.1 = 3,000, then 1,500, then $900.

Edge 1: the answer can never pass 10%

Both modifiers top out at 1, so the result is capped at 10% of the car's value no matter how bad the damage was. That cap is the main criticism of the formula, and it is worth showing in the UI instead of hiding it. I return the base loss as its own field so the page can say: this is the most the formula can ever give you.

Edge 2: the mileage table has cliffs

The worksheet prints mileage in bands:

Miles Modifier
0 to 19,999 1.0
20,000 to 39,999 0.8
40,000 to 59,999 0.6
60,000 to 79,999 0.4
80,000 to 99,999 0.2
100,000 and above 0

Two things follow. One mile can move the answer: on that $30,000 car with severe damage, 19,999 miles gives $3,000 and 20,000 miles gives $2,400. And at 100,000 miles the formula returns zero, whatever the car is worth.

The bands are written with inclusive upper ends, so I store the last mile of each band and compare with <= after flooring the input. Storing 20,000 and comparing with < works too, but then the table in the code no longer matches the table on paper, and that is how off-by-one bugs get in.

const MILEAGE_BANDS = [ { upTo: 19_999, modifier: 1 }, { upTo: 39_999, modifier: 0.8 }, { upTo: 59_999, modifier: 0.6 }, { upTo: 79_999, modifier: 0.4 }, { upTo: 99_999, modifier: 0.2 }, { upTo: Infinity, modifier: 0 }, ]; function mileageModifier(miles: number) { const m = Math.max(0, Math.floor(miles)); return MILEAGE_BANDS.find((b) => m <= b.upTo)!.modifier; } 

Edge 3: the printed steps are not the only values

The worksheet lists damage modifiers in steps of 0.25. I first modelled them as an enum. Then I read a real insurer letter that applied a 10% damage modifier and a 21% mileage modifier, values that are on no printed table. So the function takes plain numbers from 0 to 1, and the enum is only a convenience for the form.

The lesson I took: when you turn a paper worksheet into code, find a filled-in example before you pick your types.

What the code does not tell you

The formula is one insurer practice, not a law, and many appraisers think it understates the loss. A calculator should say that next to the number. Mine also shows a rough cross-check against the repair bill.

The calculator, with the sources for the tables, is here: https://claimfigures.dpdns.org/diminished-value-calculator