Fix divide-by-zero errors in Excel variance formulas

Eliminate #DIV/0! errors in budget variance calculations with clean, professional handling for zero or missing values.

Text prompt for ChatGPT and Claude

You get: Recommended Formulas, logic Matrix and display Formatting Advice

Prompt

Prompt
Act as an FP&A analyst. Provide clear Excel formulas to calculate percentage variances without producing #DIV/0! errors when budget or baseline rows are zero.

- Provide the clean formula using modern functions (IF, IFERROR, LET).
- Clearly explain how to treat zero baseline with positive actuals versus zero baseline with zero actuals.
- Show formatting conventions for N/A, dashes, or 0.0% output.
- Keep explanations concise and ready to apply immediately.

Output format:
1. Recommended Formulas (Standard and Modern LET)
2. Logic Matrix (Actual vs. Budget combinations)
3. Display Formatting Advice

My actual and budget column references are below:

Example output

Example for: Actual in column B, Budget in column C starting at row 2

1. Recommended Formulas

Standard Excel (Universal):
=IF(C2=0, IF(B2=0, 0, "N/A"), (B2-C2)/C2)

Modern Excel (Using LET for Readability):
=LET(act, B2, bgt, C2, IF(bgt=0, IF(act=0, 0, "N/A"), (act-bgt)/bgt))

(Note: Replace "N/A" with "-" if required by your corporate financial reporting standard.)

2. Logic Matrix
BudgetActualResultMeaning
$100$120+20.0%Normal calculation (Actual - Budget) / Budget
$0$00.0%No variance planned or incurred
$0$500N/A (or Dash)Unbudgeted expense; percentage change is mathematically undefined
$500$0-100.0%100% budget savings; valid calculation
3. Display Formatting Advice
  1. Select your variance column and format as Percentage with 1 decimal place.
  2. To make text like N/A align cleanly with numbers, apply this Custom Number Format:
    0.0%;(0.0%);0.0%;@
  3. For presentation tables, avoid using pure IFERROR(..., 0) because reporting an unbudgeted spend of $50,000 as 0.0% variance hides budget non-compliance from leadership.
Written by AI from this prompt. Your results will vary.

Paste your formula, column letters, or table layout into ChatGPT, Claude, or Gemini after the prompt. Ask for conditional formatting rules to highlight unbudgeted expenses.

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

Excel & Spreadsheets

Build a 3D sum formula across multiple monthly tabs

Create a reliable 3D formula to aggregate identical cell references across multiple monthly worksheets into a single summary sheet.

Excel & Spreadsheets

Clean phone numbers and postal codes using Excel formulas

Transform irregular contact details into uniform formats for clean CRM imports. Use this whenever raw exports mix dashes, dots, spaces, or leading zeroes.

Excel & Spreadsheets

Handle cost and revenue variance signs in Excel

Standardize variance calculations across mixed revenue and expense lines so favorable outcomes consistently display correctly.

Excel & Spreadsheets

Deduplicate spreadsheet rows keeping latest entry

Finds duplicate records in your data and generates clean formulas or step-by-step instructions to keep only the newest record.

Excel & SpreadsheetsGemini

Write Google Sheets REGEX Formulas to Extract and Clean Text

Get ready-to-paste REGEXEXTRACT, REGEXREPLACE, or REGEXMATCH formulas for Google Sheets with a token-by-token breakdown.

Excel & Spreadsheets

Create Dynamic Excel Dashboard Arrays with Filter Unique and Sort

Generate a single robust Excel formula that pulls, filters, and sorts data into a dynamic spilled range that updates automatically as your source data changes.