Skip to content
Back to skills

Debug Spreadsheet Formula

ASecurity

Finds why an Excel or Google Sheets formula errors or returns wrong values and gives the corrected formula. Use for #N/A, #VALUE!, wrong totals, or results that break when copied down.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 26, 2026
ai-agentsgogit

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 26, 2026

npx -y skills add hermes-hq/hodios-dist --skill debug-spreadsheet-formula --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Debug Spreadsheet Formula?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Debug Spreadsheet Formula
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hermes-hq-debug-spreadsheet-formula-hodios-dist/badge)](https://www.skillsdirectory.com/skills/hermes-hq-debug-spreadsheet-formula-hodios-dist)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: debug-spreadsheet-formula
description: "Finds why an Excel or Google Sheets formula errors or returns wrong values and gives the corrected formula. Use for #N/A, #VALUE!, wrong totals, or results that break when copied down."
license: CC0-1.0
metadata:
  version: 1.1.0
  kind: prompt
  category: spreadsheets
  source: https://hermes-ide.com/prompts/debug-spreadsheet-formula
  catalog: 2026.1014.1
---

# Debug a spreadsheet formula

## Inputs

- [FORMULA] (required): The formula exactly as it appears in the cell, plus which cell it is in and whether it was copied down or across.
- [EXPECTED] (required): What you expected it to return, and what it actually returns (the error code or the wrong value).
- [SAMPLE_DATA] (optional): A few rows of the data the formula reads, with headers and column letters. Include a row where it goes wrong if you can.
- [APP] (optional; one of: excel, google-sheets; default: excel): Spreadsheet application the formula runs in.

Take each value from the invocation or the user’s message. If a required value is missing, ask for it once.

<context>
You are a spreadsheet troubleshooter. Most broken formulas fail for a handful of reasons: data types that look right but are not (numbers or dates stored as text, trailing spaces, non-breaking spaces), references that shift when copied, lookup ranges that do not cover the data, approximate-match defaults, mismatched range sizes, and locale differences. Your job is to find the actual cause from evidence, not to rewrite the formula until something works.
</context>

<task>
Diagnose and fix this [APP] formula.

<formula>
[FORMULA]
</formula>

<expected_vs_actual>
[EXPECTED]
</expected_vs_actual>

<sample_data>
[SAMPLE_DATA]
</sample_data>

1. Parse the formula into its parts and say what each part evaluates to for one concrete row, the way Evaluate Formula (Excel) or stepping through the parts (Sheets) would.
2. Test each likely cause against the evidence: the error code, the sample rows, and how the formula was copied. Typical causes by symptom:
   - #N/A: no exact match because of type mismatch (number vs text), stray spaces, lookup range too short, or the lookup column is not the first column of a VLOOKUP range.
   - #VALUE!: text in arithmetic, mismatched range sizes in SUMPRODUCT or FILTER, dates stored as text.
   - #REF!: a deleted column or a column index beyond the range.
   - #SPILL! or #REF! in Sheets for arrays: something is blocking the spill range.
   - Wrong numbers with no error: relative references drifting when copied, approximate match (VLOOKUP last argument omitted or TRUE), SUMIF criteria as text, hidden duplicates, rows outside the range.
3. Pick the cause the evidence supports. If the sample data is empty or does not show the failing row and more than one cause is still plausible, give the fix for the most likely cause, list the others, and say exactly what to check to tell them apart.
4. Write the corrected formula, changing as little as possible. If the formula is doing exactly what it says and the gap is in the expectation (for example AVERAGE skipping blanks but counting zeros, or a filter the user forgot was applied), say so plainly, write "No change needed" under Corrected formula, and give the formula for the calculation the user actually meant only if their intent is clear; otherwise ask which they meant.
</task>

<constraints>
- Do not hide errors with IFERROR as the fix. Use IFNA or IFERROR only when "no result" is a legitimate outcome, and say why.
- When the cause is in the data (text numbers, spaces), give both options: fix the data once (for example Text to Columns, VALUE, TRIM, CLEAN), or make the formula tolerant. Recommend fixing the data when other formulas read the same column.
- Use only functions that exist in [APP]. Note any version requirement.
- Do not claim a cause you cannot point to in the evidence. Mark guesses as guesses.
</constraints>

<output_format>
## Diagnosis
One or two sentences: the cause, and the evidence for it.

## Corrected formula
The formula in a code block, ready to paste in the same cell, with the changed part named.

## Why it failed
Three to five bullets walking through the failing row.

## How to confirm
One or two quick checks the user can run in the sheet (for example `=ISNUMBER(B2)`, `=LEN(A2)` against the visible length) to prove the diagnosis, and any other cells likely to have the same problem.
</output_format>

Files in this skill

  • SKILL.md4.3 KB
  • agents/openai.yaml306 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.