Debug Broken Spreadsheet Formulas and Lookup Errors in Canvas

Audits spreadsheet formula exports to pinpoint syntax mistakes, circular references, and lookup mismatches with side-by-side corrections.

Text prompt

You get: Summary Table, corrected Formulas and edge Case Warnings

Prompt

Prompt
Act as a senior spreadsheet engineer and financial systems analyst. I will paste a list of broken spreadsheet formulas, their cell references, and the error codes they return (such as #N/A, #REF!, or #VALUE!).

Your job is to inspect each formula and deliver clean, working replacements in ChatGPT Canvas.

Rules:
1. Classify each issue strictly into one of three buckets: Syntax/Typo, Circular Reference/Range Conflict, or Lookup/Type Mismatch.
2. For every broken formula, provide the exact corrected formula ready to paste into Excel or Google Sheets, using standard uppercase formula names.
3. Include a concise, one-sentence explanation of what failed and why the fix works.
4. If an error stems from missing data or mismatched text-versus-number formatting, provide a defensive wrapper such as IFERROR or TRIM.

Output format:
- Summary Table: Columns for Cell Reference, Original Error, Error Type, and Root Cause.
- Corrected Formulas: Numbered list displaying the Cell Reference, the Original Formula in an inline code span, the Corrected Formula in a code block, and a short explanation line.
- Edge Case Warnings: Bullet list highlighting any assumptions made about sheet tab names, locale separators, or data ranges that could still cause errors.

Example output

Three broken formulas found and fixedEach cell gets an error type and a corrected formula
  1. D14: lookup mismatch#N/AVLOOKUP lacked exact match; swapped to XLOOKUP with TRIM
  2. G22: circular reference#REF!SUM range included G22; shrunk to G2:G21
  3. H08: syntax typo#VALUE!Quoted the text string and removed extra parenthesis

Example for: an e-commerce revenue report with broken lookup references and mismatched column ranges.

Summary Table
Cell ReferenceOriginal ErrorError TypeRoot Cause
D14#N/ALookup/Type MismatchVLOOKUP exact match flag omitted, failing on unsorted text SKU keys.
G22#REF!Circular Reference/Range ConflictSUM formula range includes G22, creating a circular loop.
H08#VALUE!Syntax/TypoMismatched closing parenthesis and unquoted string token in IF statement.
Corrected Formulas
  1. Cell D14
    Original: =VLOOKUP(A14, Inventory!A2:D500, 4)
=IFERROR(XLOOKUP(TRIM(A14), TRIM(Inventory!A2:A500), Inventory!D2:D500, 0, 0), 0)

Swapped to XLOOKUP with TRIM on the lookup key to eliminate trailing space mismatches and forced an exact match with a zero default value.

  1. Cell G22
    Original: =SUM(G2:G22)
=SUM(G2:G21)

Shrank the sum interval to stop at G21, eliminating the circular reference caused by the formula consuming its own cell.

  1. Cell H08
    Original: =IF(C08>100, Eligible, 0))
=IF(C08>100, "Eligible", 0)

Enclosed the text string in standard double quotes and removed the extra closing parenthesis.

Edge Case Warnings
  • The XLOOKUP replacement in D14 requires modern Excel (2021+) or Google Sheets; use =IFERROR(VLOOKUP(TRIM(A14), Inventory!A2:D500, 4, FALSE), 0) if supporting Excel 2019 or earlier.
  • If your regional system settings use semicolons as formula separators instead of commas, replace all commas accordingly.
Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Classifying formulas into three error buckets forces the model to diagnose underlying data types instead of only patching obvious syntax.
  • Requiring defensive wrappers like TRIM and IFERROR prevents recurring errors caused by subtle spacing bugs or missing source rows.
  • Canvas side-by-side formatting keeps original code, fixes, and cell coordinates aligned so they can be copied directly back to sheets.

Paste your failing spreadsheet formulas, target cell coordinates, and error messages directly below this prompt in ChatGPT Canvas mode.

Common edits

  • Swap modern XLOOKUP suggestions back to classic INDEX/MATCH syntax if your team supports older on-premise Excel versions.
  • Add a rule instructing ChatGPT to switch comma separators to semicolons for European desktop spreadsheet locales.

Reuse it: Use in a workflowTurn into a skillAdapt in the builder

More in ChatGPT
Coding

Build an Excel Formula from a Plain-English Description of What You Need

You get a working Excel formula, versions for older Excel and Google Sheets, a one-row worked example, and a table of the blank and error cases it handles.

Excel & Spreadsheets

Translate plain English requests into Google Sheets QUERY

Transforms plain business questions into working Google Sheets QUERY formulas with correct syntax, quotation marks, and date formats.

Excel & Spreadsheets

Set Up Data Validation Rules That Stop Bad Entries in a Shared Excel Sheet

You get a column-by-column validation plan with allowed values, custom formulas, input and error messages, plus a helper formula that flags rows already holding bad data.

Excel & Spreadsheets

Fix an Excel or Google Sheets Formula That Returns an Error or Wrong Result

Get a ranked list of the likely reasons your formula fails, a quick check for each, and a corrected formula you can paste straight into your sheet.

AI Business Workflows

Excel and Google Sheets Formula Builder With a Plain-English Explanation

Writes the formula for what you want a spreadsheet to do, in both Excel and Google Sheets syntax, explains each part, and gives a test case so you can check it works.

Excel & Spreadsheets

Write an Excel or Google Sheets Formula from Plain English

Get a ready-to-paste Excel or Google Sheets formula built for your version and columns, with a step-by-step walkthrough and one test case to check it.