---
name: compare-spreadsheet-versions
description: "Compare two versions of a spreadsheet or table by a stable row key, list added, removed and changed cells, and set aside keys that are duplicated. Use when someone asks what changed between two workbooks, exports, price lists or registers."
license: CC-BY-4.0
metadata:
  author: Raq.com
  version: "2026-11-22"
  homepage: https://skills.raq.com/skills/compare-spreadsheet-versions
---

# Compare two spreadsheet versions

Match rows by a stable key and produce a cell-level change list even when records have moved or a key has been reused.

## When to use this skill

- Someone has an old and a new version of a spreadsheet, price list or export and wants a list of changes.
- Rows have been reordered, inserted or deleted, so a row-by-row comparison would show false differences.
- A formula may have changed even though the displayed values look the same.

## When not to use it

- Merging the two versions or deciding which change is right. The skill reports differences for the owner to decide.
- Auditing the formulas within one version. Use the spreadsheet formula audit skill.

## What you need

- Two labelled tables with column names and a declared row key.
- Which columns to compare and any explicit type or equivalence rules.

## Ask before you start

If any of these are missing or unclear, ask before doing the work.

- Which column or columns identify the same record in both versions, such as an order number or SKU?
- Which columns matter, and have any been renamed, added or removed between versions?
- Should formulas be compared, or only the displayed values? A values-only export cannot show a formula change.

## Method

1. Keep the original values. Confirm which sheet, columns and key parts describe the same record in both versions. For a composite key, compare the parts separately.
2. Map columns by name, not position. Resolve renamed, added and removed columns with the owner before comparing, and report under the original name when asked. A missing column is not the same as a blank cell.
3. Index each version by key. Set aside every key that appears more than once on either side before computing differences, and ask for another identifier when a key is blank.
4. For the remaining keys, report rows present on only one side. For a shared key, compare the requested columns as text exactly as displayed, preserving identifiers, unless a type rule explicitly allows a conversion.
5. If formula changes matter, compare the formula text as well as the displayed or calculated values. A changed input can change many calculated cells, so trace each difference back to the cell that was edited.
6. Check that unique matched, added, removed and ambiguous keys account for every row in both versions. A row that only moved contributes no changed cells.

## Checks before you deliver

- Repeated customer names can describe separate orders. A matching row number provides no evidence that two orders are the same.
- A missing column has a different meaning from a blank cell. Resolve header changes before comparing values.
- Comparing by row position. One inserted row makes every later row look changed.
- Converting values before comparing. 8.50 and 8.5, or 007 and 7, are equal as numbers but different as displayed text; follow the stated comparison rule.
- Matching one of several rows that share a key. Choosing either row manufactures a match.

## How to present the result

Lead with counts of rows added, removed, changed and set aside as ambiguous. Then give the change table sorted by key and column with before and after values, followed by the added and removed keys and the duplicated keys that need a better identifier. Mention rows that only moved, so nobody looks for a change that is not there.

## Worked example

**Request:** Compare price by sku, using display values.

**Supplied material:**

```text
Before
sku,price
A01,8.50
B02,4.00
C03,7.00
After
sku,price
C03,7.00
A01,9.00
D04,1.50
```

**Answer:** A01 changed from 8.50 to 9.00. B02 was removed and D04 was added. C03 moved rows and kept its price of 7.00.

## Structured output for tests

For an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.

Return added, removed and ambiguous as sorted lists of text keys. Return changed as objects with key, column, before and after, sorted by key then column. For display-value comparisons return before and after as strings. For a formula comparison return the original formula strings including the equals sign.

## Sources

- [W3C: Metadata vocabulary for tabular data](https://www.w3.org/TR/tabular-metadata/): The primaryKey property requires each row to have a unique combination of key values, and column metadata says how values are interpreted. This is why the skill sets aside duplicated keys instead of guessing a match.
- [Microsoft: Basic tasks in Spreadsheet Compare](https://support.microsoft.com/en-us/excel/basic-tasks-in-spreadsheet-compare): Spreadsheet Compare lets the user include formulas in a comparison and colours entered values and changed calculated values differently. Its worked example shows a corrected formula changing a calculated total, and Microsoft suggests the tool for finding manually entered totals and broken formulas.

Test cases and an answer checker for this skill: https://skills.raq.com/skills/compare-spreadsheet-versions
