Skip to main content

Make sense of a messy table

Inspect a messy synthetic spreadsheet, spot missing rows and unit traps, and check whether the summary matches the numbers.

1. Scenario

Pick a work role starter with synthetic material, or switch to Bring your own.

Year 4 library book loan counts

Education · Synthetic material

The library export shows Class 4B borrowed twice as many books as Class 4A in October, and you want to check the rows before announcing it in assembly.

loan_id,class,pupil_code,book_title,scanned_at
L-201,4A,P01,River Otter,2026-10-05 09:10
L-202,4A,P02,Cloud Atlas Junior,2026-10-05 09:11
L-203,4B,P14,Stone Age Tools,2026-10-06 10:02
L-204,4B,P14,Stone Age Tools,2026-10-06 10:02
L-205,4B,P15,Roman Roads,2026-10-06 10:04
L-206,4B,P15,Roman Roads,2026-10-06 10:04

2. Work area

Edit the briefs or setup below before you run.

Only the header row, inferred column types, and at most 20 sample rows leave your device. The analysis function runs in your browser on all rows.

5 columns · 24 total rows · 20 sample rows leave device

Answer and chart

Example. No model ran.

9 of 24 pupils need the Tuesday lunchtime catch-up lab. Group 8B has the highest need with 5 pupils.

Inline SVG chart8B58A28C2
Steps in plain words
  1. 1. Filter rows where lab_status equals catch-up across all three Year 8 groups.
  2. 2. Count total pupils and catch-up pupils per class group (8A, 8B, 8C).
  3. 3. Expose the catch-up rows so the teacher can verify the headcount before booking the lab room.
Inspect the analyze(rows) code that ran in your browser
function analyze(rows) {
  const groups = {};
  let totalCatchUp = 0;

  for (const row of rows) {
    const grp = String(row.group || "Other");
    if (!groups[grp]) {
      groups[grp] = { group: grp, pupils: 0, catchUpNeeded: 0 };
    }
    groups[grp].pupils += 1;
    if (String(row.lab_status) === "catch-up") {
      groups[grp].catchUpNeeded += 1;
      totalCatchUp += 1;
    }
  }

  const table = Object.values(groups).sort((a, b) => b.catchUpNeeded - a.catchUpNeeded);
  const chart = table.map((g) => ({ label: g.group, value: g.catchUpNeeded }));

  return {
    answer: totalCatchUp + " of " + rows.length + " pupils need the Tuesday lunchtime catch-up lab. Group 8B has the highest need with " + (table[0] ? table[0].catchUpNeeded : 0) + " pupils.",
    table,
    chart,
    checkOne: {
      label: "Pupils marked for catch-up lab",
      figure: totalCatchUp,
      column: "lab_status",
      equals: "catch-up",
      mode: "count"
    }
  };
}

Check one number by hand

Reported: 9 · Rows found: 9

Pupils marked for catch-up lab: Filter where lab_status equals catch-up. Below are all 9 matching rows from the 24-row spreadsheet so you can count or sum them yourself.

1. pupil_code: P-02 · group: 8A · attendance_pct: 84 · lab_status: catch-up · quiz_score: 12
2. pupil_code: P-04 · group: 8B · attendance_pct: 79 · lab_status: catch-up · quiz_score: 11
3. pupil_code: P-06 · group: 8C · attendance_pct: 81 · lab_status: catch-up · quiz_score: 13
4. pupil_code: P-08 · group: 8B · attendance_pct: 88 · lab_status: catch-up · quiz_score: 14
5. pupil_code: P-11 · group: 8B · attendance_pct: 82 · lab_status: catch-up · quiz_score: 12
6. pupil_code: P-13 · group: 8A · attendance_pct: 85 · lab_status: catch-up · quiz_score: 13
7. pupil_code: P-17 · group: 8B · attendance_pct: 78 · lab_status: catch-up · quiz_score: 10
8. pupil_code: P-18 · group: 8C · attendance_pct: 86 · lab_status: catch-up · quiz_score: 14
9. pupil_code: P-23 · group: 8B · attendance_pct: 83 · lab_status: catch-up · quiz_score: 13

3. Run

Nothing leaves your browser until you press Run.

Sends only the column header and at most twenty sample rows when you press run. to job data_code (claude-sonnet-5-5, effort medium). Raw text is processed in memory and not stored.

4. Inspect

See what left the browser, which model ran, and the receipt.

Example. No model ran. · source: offline
What left the browser

Nothing sent yet. When you run, only headers and at most 20 sample rows leave this device.

What stayed on device

All 24 rows stay in your browser and run inside the sandboxed Web Worker.

Model and job

data_code · claude-sonnet-5-5 (effort medium, max 1600 tokens). Haiku reads the schema and sample rows to propose checks you can verify against the full table.

Runs and source

0 runs used · source: offline · Example. No model ran.

5. Judge

Did the summary deduplicate L-203/L-204 and L-205/L-206 before comparing the two classes?

80%

50 is a coin flip. 99 is certain. Honest confidence scores best.

6. Debrief and Keep

What to check next time, the matching lesson, and keeping this setup as a recipe.

What to check next time

Handheld library scanners often bounce and log two rows at the same timestamp. Counting rows without checking the grain doubles the total.

Keep as a recipe

Save the stronger brief and scenario setup to your device so you can reuse or adapt it in Keep.

Open Keep