悄悄算错比明显报错更可怕。#REF! 至少会喊出来;而一个看着合理、实则算错的合计,会一路混进董事会的 PPT。好的诊断 Prompt 做的事和你手动排查一样:先读错误码,再走一遍依赖链,定位那一个坏单元格,最后给出一个你能先验证、再信任的修法。
下面 12 个 Prompt 与模型无关——粘到 ChatGPT、Claude、Gemini,或任何表格内置助手里都能用。截至 2026 年 6 月,真正”住在格子里”的三个助手是:Claude for Excel(加载项,含在 Claude Pro $20/月 内,跑 Claude Opus 4.7,能给出单元格级引用并保留所有依赖关系)、Microsoft Copilot in Excel(最擅长解释和调试一条已有公式)、以及 Google Gemini in Sheets(免费,侧边栏现在不只会写公式,还会解释公式为什么失败)。哪个挨着你的数据就用哪个,下面的 Prompt 在任意一个里都通用。
一句话总结
- 先读错误码——
#REF!、#N/A、#VALUE!、#SPILL!、#CALC!各有不同的根因和修法(见下表)。 - 别让 AI”直接帮你改好”。让它先诊断、再给方案、并告诉你该核对什么——然后自己对着原数据验证。
- Prompt 配合 Excel 自带的公式审核:追踪引用单元格(
Ctrl+[)、追踪从属单元格(Ctrl+])、公式求值,都在「公式」→「公式审核」里。 - 做任何雪崩式修复前,先存一份备份。一场
#REF!风暴可能就差一次错误的撤销就更糟。 #N/A最常见的真实原因不是值缺失,而是查找键里有多余空格,或数字被存成了文本。
错误码速查
| 错误 | 含义 | 最常见的真实原因 | 第一步先试 |
|---|---|---|---|
#REF! | 引用已失效 | 被引用的行、列或工作表被删了 | 撤销,或用追踪引用单元格重建引用 |
#N/A | 找不到值 | 查找键有多余空格,或数字被存成文本 | 用 TRIM() 去空格,用 VALUE() / *1 转类型 |
#VALUE! | 参数数据类型不对 | 该填数字的地方填了文本,或夹了空格 | 逐个检查参数类型,用 ISTEXT() 揪出元凶 |
#SPILL! | 动态数组无法溢出 | 溢出区被占用,或与输入区重叠 | 清空挡路的单元格,或把公式挪离自己的输入区 |
#CALC! | 数组计算失败 | 数组结果为空,或嵌套数组不被支持 | 加一个兜底值,简化嵌套数组 |
#DIV/0! | 除以零或空值 | 刷新时分母单元格为空 | 确认该空是预期的,再用 IFERROR() 包 |
#NAME? | Excel 不认识某个名称 | 函数拼错,或命名区域被删 | 检查拼写;「公式」→「名称管理器」 |
#NUM! | 数值结果无效 | 结果过大,或不可能的运算(负数开方) | 给输入加上合理边界 |
(来源:Microsoft Support、Exceljet。)
这套 Prompt 适合哪些场景
#REF!/#N/A/#VALUE!/#SPILL!分类排查- 解开循环引用
- 截止前的悄悄算错排查
- 日期和数字格式不一致
- VLOOKUP / XLOOKUP 查找键不匹配
12 个可直接复制的 Prompt 模板
把方括号里的 [占位符] 换成你的真实值。诊断类 Prompt 保留”先别改”这句,逼模型先解释再动手——它的信任就是这么赢来的。
1. 读错误码
Cell [cell, e.g. F12] shows [error, e.g. #N/A]. Diagnose:
(1) the most likely cause for THIS error code,
(2) the first thing I should check,
(3) one cheap fix to try,
(4) when to escalate to a rebuild.
Don't fix yet — explain first.
替换: 单元格、错误码
2. 追踪依赖
Cell [cell] is wrong. Walk me through tracing it in Excel:
(1) which cells feed it (precedents — I'll use Ctrl+[ ),
(2) which cells depend on it (dependents at risk — Ctrl+] ),
(3) where in the chain the value most likely broke.
Tell me what each Trace Precedents arrow color means.
替换: 单元格
3. 解开循环引用
My workbook reports a circular reference. Walk through:
(1) finding the cells (Formulas > Error Checking > Circular References),
(2) describing the logical loop in plain English,
(3) breaking it — when to use iterative calculation
(File > Options > Formulas) vs. an intermediate helper cell
vs. refactoring the formula. Output a step-by-step plan.
4. 悄悄算错检查
A KPI cell [cell] shows a plausible but suspicious number.
Walk me through verification:
(1) sanity-check the inputs (SUM, COUNT, MIN, MAX),
(2) compare to the prior period,
(3) manually compute one row by hand,
(4) compare that to the formula's output.
Name the exact discrepancy and where it enters.
替换: 单元格
5. 日期格式诊断
My date math returns wrong results. Diagnose these causes in order:
(1) dates stored as text (left-aligned, ISTEXT = TRUE),
(2) locale mismatch (DD/MM vs MM/DD),
(3) mixed types in the column,
(4) two-digit years rolling to the wrong century.
For each: how to detect it, and the exact fix.
6. lookup 不匹配
[VLOOKUP or XLOOKUP] returns #N/A but the value is visibly in the table.
Diagnose, ordered cheapest fix first:
(1) trailing/leading spaces (test with TRIM),
(2) number stored as text vs. real number,
(3) exact vs. approximate match argument,
(4) the lookup key isn't in the FIRST column (VLOOKUP only).
Give me the corrected formula for the most likely cause.
替换: 函数名
7. pivot 刷新失败
My pivot table refresh errored. Diagnose:
(1) source range moved or shrank,
(2) new columns inserted into the source,
(3) a calculated field references a renamed/missing column,
(4) a filter references a field that was removed.
Tell me how to repoint the source to a Table (Insert > Table) so this stops recurring.
8. Power Query 错误
A Power Query / external data refresh failed with: [paste the exact error message].
Walk through the likely causes in order:
source path moved, credentials expired, schema/column renamed,
data-type change, or API rate limit.
Output the single most likely cause + the exact fix step.
替换: 错误信息
9. #SPILL! 与重算雪崩
[Cell shows #SPILL! / a small edit caused a cascade of #REF! and #N/A].
Diagnose:
(1) is the spill range blocked by existing content,
(2) does the dynamic array overlap its own input range,
(3) was a row/column deleted, or a named range broken,
(4) did a chart or pivot lose its source.
Output an isolation plan that fixes the source, not the symptoms.
替换: 方括号里的场景
10. 修 vs 重建
This sheet has [N] errors and unclear logic.
Decide for me:
(a) fix in place (estimate the hours),
(b) rebuild from clean inputs (more time, cleaner result).
Use these criteria: who owns it, how often it runs,
how readable the logic is, and the cost of it breaking again.
Recommend one with a one-line reason.
替换: 错误数量
11. 截止前 30 分钟急救
I have 30 minutes before I send this. Triage into three buckets:
(1) errors a stakeholder will SEE (visible #REF!, #N/A),
(2) hidden errors that corrupt the headline totals,
(3) items I can safely mark "TBD" and follow up on.
Output a prioritized fix order, totals first.
12. 表格事故复盘
My sheet showed a wrong number during a review.
Write a 200-word post-mortem:
(1) what went wrong (specific cell/formula),
(2) why the existing checks didn't catch it,
(3) ONE concrete process change
(peer review of inputs, separating inputs from calcs,
adding a reconciliation row, version control).
怎样拿到一个真能信的修法
- 让模型先诊断再动手。“先别改”逼它给出原因,而不是猜一个答案。
- 让它用数字说明差异,别用形容词——“合计差了 4200,可追溯到第 47 行”远胜过”看着有点不对”。
- 自己对着原数据验证。你给的是软输入时,AI 会编出看似合理的数字;除非你粘贴真实单元格或用表格内置加载项,否则它看不到你的真实数据。
- 依赖复杂的模型用表格内置助手。Claude for Excel 会读完整个工作簿,并为每条结论标出具体单元格——当一个标签页里的修改会悄悄弄坏另一个标签页时,这点很关键。
- 改完后重跑公式审核工具——追踪从属单元格(
Ctrl+])会显示出你这次改动牵连到的所有下游单元格。
哪种 AI 工具配哪种活(2026 年 6 月)
| 工具 | 运行位置 | 最擅长 | 价格 |
|---|---|---|---|
| Claude for Excel | Excel 加载项(Opus 4.7) | 审多标签页模型、单元格级引用、保留依赖 | 含在 Claude Pro,$20/月 |
| Microsoft Copilot in Excel | Excel 内 | 解释和调试单条公式、大白话讲解 | M365 Copilot 附加项 |
| Google Gemini in Sheets | Sheets 侧边栏 | 免费解释公式 + 诊断失败、XLOOKUP/LAMBDA | Google AI Pro / Sheets 内免费 |
| ChatGPT / Claude(对话) | 浏览器 | 粘公式 + 错误,求个快速第二意见 | 有免费档 |
FAQ
- AI 能看到我真实的表格吗?:只有表格内置加载项(Claude for Excel、Copilot、Gemini in Sheets)能读你的真实单元格。在对话窗口里,你必须把公式、错误和几行样例数据粘进去,否则模型是在猜。
- 值明明在表里,#N/A 最常见的原因是什么?:查找键里有多余空格,或数字被存成了文本。先用
TRIM()去空格、把类型转对,再去怀疑更复杂的原因。 - 修好 #REF! 后怎么防它再来?:把数据转成表格(
Ctrl+T)并用结构化引用。这样删行就不会再毒害指向该区域的公式。 - 是不是把所有东西都用 IFERROR 包起来就行?:不行。
IFERROR()只盖住症状、不治根因,还可能掩盖真正的算错。只有在确认该错误是预期的(例如分母为空应读作 0)时才用它。 - Claude for Excel 的 $20/月 比免费 Gemini 值吗?:偶尔问一条公式,免费的 Gemini in Sheets 完全够用。但要审依赖关系重要的多标签页财务模型时,Claude for Excel 通读整本工作簿加单元格级引用,对得起这个价。
- AI 能自己生成底层数据吗?:不能。你让它编,它就会编出看似合理的数字。把它接到真实数据源上,并把它产出的每个数都当成待验证的草稿。