Back to Playbooks

Inherited a Broken Sheet

Rescue
~30 minutes

You just inherited a Google Sheet from your predecessor. It's covered in #REF! errors, no documentation exists, and nobody remembers what it's supposed to do. You need to understand it, fix it, and document it before it breaks something downstream.

The Slack Message

KR
VP Sales — New Boss9:14 AM

Hey — this is Terri's pipeline tracker. It broke about 6 months ago when she left and nobody's been able to fix it. We need it working by Friday because we have a board meeting Monday. Can you take a look? Fair warning, it's a mess.

You open the sheet. 1,862 cells showing #REF!. Two tabs might be missing entirely. Friday is in three days.

The Prompt

Pasted the sheet URL into Claude Code. Let it deal with Terri's legacy.

I inherited this sheet from my predecessor: [SHEET_URL]

It's full of #REF! errors and I have no idea what it's supposed to do.

Can you:
1. Examine the sheet and tell me what it's designed to do
2. Advise top 5 improvements I should make
3. Fix all #REF! errors (I need zero showing)
4. Publish documentation to Notion explaining:
   - What this sheet does
   - What inputs it expects
   - How to use it correctly

Just Paste and Watch

You give Claude Code the problem. It figures out what Gremlin commands to run. Inspect → diagnose → snapshot → repair → validate → document. You don't need to learn the CLI — Claude Code already knows it.

How Gremlin Handles This

1

Inspect

Analyze sheet structure, formulas, data flow to understand purpose

2

Diagnose

Identify all #REF! errors and their root causes

3

Lint

Run comprehensive formula validation, find broken references

4

Repair/Rescue

Fix broken references, repair formula chains

5

Snapshot

Create versioned backup before and after

6

Publish

Generate "How This Sheet Works" documentation to Notion

After you paste this prompt, Claude Code:

"This sheet is a mess. Let me inspect the structure and understand what it's supposed to do before I try to fix anything..."

Running
$ g-gremlin inspect -s SHEET_ID --structure --lint --output .g_gremlin/profile.json
3 tabs found: Inputs, Calculations, Summary. 142 formulas detected.
Running
$ g-gremlin inspect-formulas SHEET_ID --range "A1:ZZ1000" --output formulas.json --limit 0
Extracted all formulas. Pattern detected: pipeline calculator (leads → opps → revenue)

"I see the pattern now. It's a pipeline calculator. The #REF! errors are from deleted columns that formulas still reference. Let me run a full lint..."

Running
$ g-gremlin lint SHEET_ID --rules "all" --transitive --output lint_report.json
Found 47 #REF! errors across 3 tabs, 12 dead references, 3 circular refs
Running
$ g-gremlin trace SHEET_ID --cell "Summary!C15" --direction upstream --format tree
Traced dependency chain: C15 ← Calculations!B12 ← Inputs!D5 (broken ref here)
Running
$ g-gremlin snapshot create SHEET_ID --name "pre-repair-backup"
Snapshot saved: .g_gremlin/snapshots/pre-repair-backup.json
Running
$ g-gremlin lint SHEET_ID --rules "quoting,dead-refs" --fix
Auto-fixed 35 issues (unquoted sheet names, remapped dead refs)
Running
$ g-gremlin repair SHEET_ID --apply
Repaired 12 remaining broken references
Running
$ g-gremlin lint SHEET_ID --rules "errors" --output post_fix_lint.json
0 errors found. All formulas validated.
Running
$ g-gremlin docs publish --provider notion --template sheet_docs.md --data '{"title":"Pipeline Calculator"}' --external-id sheet-doc-1 --apply
Published documentation to Notion with inputs, outputs, and dependency map

Done. Sheet repaired, 47 errors fixed, documentation published to Notion.

Results

47
#REF! errors fixed
3
Tabs analyzed
142
Formulas validated
2
Snapshots created

Documentation published to RevOps portal

Try This Workflow

Start with the quickstart guide, then rescue your own inherited sheets.

Playbook: Inherited a Broken Sheet | Deal Desk | FoundryOps