AI Spreadsheet Formula Repair Card
Overview
Use this prompt-only skill when a user has a broken spreadsheet formula and needs a fast, careful repair card they can test in Excel, Google Sheets, Numbers, or a similar spreadsheet tool.
The skill turns the user's formula, error message, expected result, and nearby sheet context into a compact diagnosis, corrected formula, sample checks, and a paste-ready explanation.
When to Use
Use this skill when the user says things like:
- "My spreadsheet formula is broken."
- "Fix this Excel formula."
- "Why does this Google Sheets formula return an error?"
- "This lookup formula is wrong."
- "I need a corrected formula and explanation."
- "Help me debug this spreadsheet formula quickly."
Required Inputs
Ask for only the details needed to repair the formula:
- Spreadsheet app, such as Excel, Google Sheets, Numbers, or unknown
- The exact formula text
- The error message or wrong result currently shown
- What the user expected the formula to return
- Relevant column headers, row numbers, cell references, named ranges, locale separators, and sample input values
- Whether the formula will be copied across rows or columns
- Any constraints, such as no helper columns, no array formulas, or compatibility with older Excel
If the user cannot share real data, ask for a small anonymized sample with the same structure.
Workflow
- Capture formula context. Restate the app, formula, target cell, observed error, expected result, and relevant sheet layout from the user-provided details.
- Identify the error type. Classify the likely issue, such as syntax, separator or locale mismatch, missing quotes, bad range shape, lookup mismatch, absolute or relative reference issue, array spill issue, date or text coercion, circular reference, unsupported function, or logic mismatch.
- Explain the root cause briefly. Point to the exact part of the formula that is probably failing. If uncertain, list the top two likely causes.
- Rewrite the formula. Provide one primary corrected formula that matches the user's spreadsheet app and constraints.
- Add safer alternatives when helpful. Include an alternate formula only if compatibility, readability, or blank/error handling materially improves the result.
- Create sample checks. Give two to five small test cases with input, expected output, and what a pass means.
- Add copy or fill notes. Warn about absolute references, relative references, structured references, array spill range, and whether the formula is safe to drag or paste.
- Prepare a paste-ready explanation. Produce a short explanation the user can paste into a note, ticket, or teammate reply.
- Give a safe testing step. Ask the user to test on a copy or duplicate sheet before replacing important formulas.
Output Format
Produce the repair card with these sections:
- Formula Repair Card
- Spreadsheet app
- Original formula
- Observed error or wrong result
- Expected result
- Diagnosis
- Error type
- Likely root cause
- Confidence: high, medium, or low
- Corrected Formula
- Primary formula
- Optional alternate formula, only if useful
- Why This Works
- Short explanation of the changed references, functions, separators, or logic
- Test Cases
- Input or scenario
- Expected output
- Pass condition
- Paste and Fill Notes
- Where to paste
- Whether it can be copied down or across
- Any references that must stay locked
- Paste-Ready Explanation
- Three to six sentences in plain language
- Safe Next Step
- Reminder to test on a copy or duplicate sheet before replacing important formulas
Example Prompts
Copy and paste one of these into your AI assistant with your broken formula and context filled in:
- VLOOKUP returning #N/A: "In Google Sheets, my formula
=VLOOKUP(B2,Sheet2!A:D,4) keeps returning #N/A even though the value should be there. Sheet2 has columns ID, Name, Dept, Salary. The ID in B2 is 1047. Fix this."
- #VALUE! from text-formatted numbers: "Excel shows #VALUE! for my formula
=A2+B2 where A2 has '100' formatted as text. I expected 250. What's the corrected formula?"
- SUMIF returning 0 unexpectedly: "My SUMIF in Excel
=SUMIF(C:C,">500",D:D) is returning 0 when I can see rows above 500. Column C has numbers stored as text. Give me a repair card."
Safety Boundary
- Use only the formula and context the user provides. Do not claim to inspect a spreadsheet unless the user supplies the content or an available tool actually opens it.
- Do not ask for passwords, account access, private workbooks, hidden sheets, credentials, or full sensitive datasets.
- Encourage anonymized sample rows when real data is sensitive.
- Warn before any destructive edit, mass paste, autofill, replacement, script, macro, or recalculation that could alter important data.
- Ask the user to test on a copy or duplicate sheet before replacing formulas in production, finance, legal, medical, payroll, inventory, or high-impact files.
- Do not invent unavailable column names, ranges, or sample values. Mark assumptions clearly.
- Do not provide executable scripts or macros as the primary answer for this skill.
Quality Checklist
A strong result should:
- Preserve the user's spreadsheet app and formula dialect
- Name the likely error type and exact root cause
- Provide a corrected formula that is ready to paste
- Include sample checks with expected outcomes
- Mention fill direction and locked references when relevant
- Keep the explanation short enough to paste into a ticket or teammate message
- Include a copy-first safety reminder before replacing important formulas