Units and Estimation

Sanity Checking Your Calculations

Practical habits for catching calculation mistakes: limit cases, unit checks, rough estimates, trend checks and independent methods, with small worked examples.

On this page
  1. Why checks matter
  2. Habit 1: know roughly what to expect first
  3. Habit 2: check the units
  4. Habit 3: test the limits
  5. Habit 4: check the trend
  6. Habit 5: compare against a known case
  7. Habit 6: bounds and plausibility
  8. Habit 7: a second, independent route
  9. Habit 8: look at the inputs
  10. Habit 9: watch the digits
  11. In spreadsheets and code
  12. What to do when a check fails
  13. A compact checklist

Why checks matter

Most calculation errors are not subtle. A decimal point slips, a unit is forgotten, a cell reference points to the wrong row, or a formula is typed from memory with one term missing. The result looks like any other number, so it is accepted. Sanity checks are quick tests that ask a simpler question than “is this exactly right?”: “could this possibly be right?”

They do not prove a result correct. They catch the large errors that matter most and cost little to find. Where design, safety or regulation is involved, they supplement, and never replace, formal review and the standards that apply in your industry.

Habit 1: know roughly what to expect first

Before calculating, guess the size of the answer. Even a rough guess within a factor of ten is useful. Afterwards, if the result is thousands of times away from the guess, one of the two is wrong, and finding out which is informative either way. Making the guess is covered in more detail in the article on back-of-the-envelope work; here the point is the discipline of doing it every time.

Habit 2: check the units

If the units of the result are not what you expected, the formula or the inputs are wrong. This takes seconds. Writing the units alongside every number during the calculation, and checking that they combine to the target unit, catches many mistakes that no amount of re-reading would. It is also the best defence against mixed-unit inputs, such as millimetres in one cell and metres in the next.

Habit 3: test the limits

Take a formula and push an input to an extreme where you already know the answer.

Example: voltage divider. For two resistors in series, with the output taken across R2, the formula is Vout = Vin × R2 / (R1 + R2).

  • If R2 is zero, Vout = 0. That is right: the output is shorted to the bottom rail.
  • If R2 is very large compared with R1, Vout approaches Vin. That is also right: almost no voltage drops across R1.
  • If R1 equals R2, Vout = Vin / 2. Correct again.

A version with R1 and R2 swapped would give Vin at R2 = 0, which fails the first test immediately.

With numbers (illustrative): Vin = 12 V, R1 = 10 kΩ, R2 = 5 kΩ gives 12 × 5 / 15 = 4 V. This lies between 0 V and 12 V, as it must, and below 6 V, since R2 is the smaller resistor.

Habit 4: check the trend

Change an input in your head and ask which way the output should move. If doubling a load should increase stress, and your spreadsheet shows stress falling, something is inverted. Directional checks are quick and cover errors that happen to produce plausible magnitudes.

Habit 5: compare against a known case

If a formula or script has a textbook example with a published answer, run that case first. Re-running a previous project with known results is another good test. If a new tool disagrees with an old one on a shared problem, investigate before moving forward.

Habit 6: bounds and plausibility

Many quantities have natural limits. An efficiency cannot exceed 100 percent. A probability lies between 0 and 1. A length cannot be negative. A passive component cannot give out more power than it takes in. When a result breaks such a bound, you have found an error without needing any other information.

Example: average speed. A trip of 60 km takes 45 minutes. Someone computes 60 × 0.75 = 45 km/h. A quick look shows the problem: covering 60 km in less than an hour must mean an average above 60 km/h. The correct calculation is 60 ÷ 0.75 = 80 km/h. Multiplying instead of dividing is a very common slip, and the bound check catches it.

Habit 7: a second, independent route

Calculate the same thing a different way: use another formula, a graph, a table, or a simplified model. If the two answers agree reasonably, confidence rises. If they disagree, find out why. A second person doing the same calculation without seeing your result is better still, since it avoids copying a shared error.

Habit 8: look at the inputs

A calculation can be perfect and still be wrong because of what went in. Re-read the source values, check that you copied the right row from a table, and confirm that you used the correct quantity from a datasheet, for example a typical rather than a worst-case figure. For tips on this, see the discussion of typical versus worst-case values.

Habit 9: watch the digits

An answer with ten digits, from inputs known to two, suggests the author did not think about it. Reporting a sensible number of digits is covered under significant figures, and it is itself a sign of a careful check. Conversely, rounding too early can introduce errors of its own.

In spreadsheets and code

Tools hide arithmetic, so build checks into them.

  • Add a cell that recomputes the result a second way.
  • Show units next to inputs and outputs.
  • Include a known test case and confirm the output after every edit.
  • For code, small unit tests with hand-checked answers play the same role.
  • Be wary of copy-and-paste formulas, where references shift unexpectedly.

What to do when a check fails

Do not adjust a number until it looks right. Treat the failed check as information: step back through the calculation, one stage at a time, comparing each intermediate value with a rough expectation. Often the error is in the check itself, which is also worth knowing. Record what you found, since mistakes teach as much as successes, and many engineering failures in the public record trace back to a simple error that a basic check could have caught.

A compact checklist

  1. Did I guess the size beforehand?
  2. Do the units come out right?
  3. Does the formula behave sensibly at extremes?
  4. Does the result move the right way when inputs change?
  5. Is it within natural bounds?
  6. Does a second method roughly agree?
  7. Are the inputs correct, and the digits sensible?

Five minutes on this list is almost always cheaper than discovering a mistake later.

The complete guide to units and estimation

Units and Dimensional Analysis for Engineers
Read the guide

Keep exploring

Guides from other topics

All topics →