What-If Analysis Logo Original What-If Analysis Logo

What-If Analysis

Data Tables for sensitivity analysis and "what-if" scenario evaluation in Google Sheets.

Overview

When modeling financial projections, loan amortizations, or stepped tax calculations, outputs frequently depend on a sequence of formulas spread across multiple cells. In such models, evaluating different assumptions requires either duplicating the calculation structure across dozens of cells or testing scenarios manually.

What-If Analysis provides automated one-variable and two-variable Data Tables. The add-on substitutes test values into defined input cells, reads the resulting model outputs, and populates a structured results table.

All calculations run securely and privately in your Google Sheet.

What-If Analysis Workflow in Google Sheets
Sensitivity matrices evaluated using the sidebar manager.

Example Configurations

1. Two-Variable (Bivariate) Matrix

Evaluates a single model output against two variable inputs arranged along the row and column axes:

Formula: =B10 (Model Output) Term: 10 Years Term: 20 Years Term: 30 Years
APR: 3.0% -$34,794.53 -$111,214.52 -$128,497.39
APR: 4.0% -$46,741.94 -$152,991.85 -$178,246.28
APR: 5.0% -$58,808.37 -$196,762.13 -$231,134.73

2. One-Variable (Univariate) Sweep

Varies a single input variable down a column while computing one or more model outputs simultaneously. Place your target output formulas in the top row directly above the result columns:

[Optional Label] Formula 1: =B6 (Monthly Pmt) Formula 2: =B10 (Total Interest)
Test Value: 3.0% $1,051.38 -$128,497.39
Test Value: 4.0% $1,189.57 -$178,246.28
Test Value: 5.0% $1,336.49 -$231,134.73
Test Value: 6.0% $1,491.42 -$286,910.92

Key Features

Named Ranges and Range Selection Tools
Support for Named Ranges with one-click range capture and cell focus.

Named Ranges and Interactive Range Tools

Power Tools and JSON Configuration Portability
Power Tools panel for backup, restoration, and configuration portability.

Power Tools and Portability

Practical Modeling Considerations

1. When to use Data Tables versus direct formulas

For simple single-step relationships, writing direct formulas across the grid calculates faster. What-If Data Tables are designed for multi-cell dependencies, loan schedules, or tiered bracket lookups where condensing the logic into a single formula is impractical or difficult to audit.

2. Multi-output evaluation in one sweep

In one-variable tables, multiple formulas can be positioned across adjacent output columns. A single parameter sweep can evaluate multiple related metrics side by side without setting up separate tables.

3. Manual recalculation preserves performance

Tables do not recalculate on every keystroke. This prevents large scenario tables from introducing spreadsheet calculation latency during normal edits. When base assumptions change, recalculation is triggered on demand through the sidebar.

Working Example Spreadsheet

You can make a copy of the Reference Example Spreadsheet to inspect working models for:

Getting Started

  1. Install the add-on from the Google Workspace Marketplace.
  2. Open your spreadsheet, click What-If Analysis > Open Sidebar.
  3. Specify the table range and the target input cells, then select Save & Calc.

Support

What-If Analysis is provided as an open-source project, and community contributions are welcome on GitHub. If you need support, encounter a bug, or have a feature request, please log in to GitHub and file an issue.