---
name: audit-a-spreadsheet-total
description: "Trace a mismatch to its row before you change a spreadsheet."
---
# Find the row behind a wrong total

## Inputs
Rows with order IDs and amounts

## Procedure
Ask for a row-by-row sum and a second sum grouped by ID. Give a rule for repeats so the model has a reason to flag a row.
Use the pasted table. Each order ID should occur once. Compute the raw total, showing the addends. Flag repeated IDs by row. Compute a proposed corrected total only when duplicate rows have identical amounts. If the amounts differ, ask which is valid. Report the difference from the raw total. Leave the original rows intact.

## Verify
Sum the original amounts yourself. Change row 3 to 45 and rerun. A good answer flags conflicting amounts and asks which record is valid.

## Test with the sample
Row | Order ID | Amount
1 | A17 | 40
2 | B22 | 65
3 | A17 | 40
4 | C31 | 25

## Expected example
Raw: 40 + 65 + 40 + 25 = 170. Rows 1 and 3 both record A17 at 40. Counting A17 once gives 40 + 65 + 25 = 130. Difference: 40. Verify the order record before removing either row.

## Further practice
https://aiquestiondesk.com/prompts/audit-a-spreadsheet-total
