[]
What‑If Analysis is a modeling technique used to evaluate how changes in one or more input values affect the result of a formula.
Instead of manually modifying cells and recalculating repeatedly, What‑If Analysis allows you to systematically explore different scenarios and observe how results respond to varying assumptions.
SpreadJS provides two complementary approaches to perform What‑If Analysis:
Data Table Analysis using the SJS.TABLE worksheet function
Goal Seek Analysis using the GC.Spread.Sheets.CalcEngine.goalSeek method
Although both features support scenario‑based evaluation, they serve different purposes and operate differently.
SJS.TABLE evaluates a result cell or range across multiple input combinations and returns the collected results as a dynamic array.
It is implemented as a standard worksheet formula, which means it:
Participates in normal worksheet recalculation
Can be edited, copied, and nested inside other functions
Automatically spills results into adjacent cells
In addition, SJS.TABLE:
Supports dynamic arrays and inline arrays
Allows multiple input variables in a single formula
Supports cross‑sheet references and named ranges
Data Table Analysis is best suited for comparing outcomes across predefined sets of input values.
goalSeek is an imperative calculation method that adjusts the value of a specified cell until a formula reaches a desired target result.
Unlike SJS.TABLE, Goal Seek:
Modifies the changing cell directly
Uses an internal numerical solving algorithm
Returns a boolean or Promise<boolean>
Operates through the CalcEngine API rather than a worksheet formula
Goal Seek is best suited for solving inverse problems, such as determining what interest rate produces a specific payment amount.
Feature | Data Table ( | Goal Seek ( |
|---|---|---|
Type | Worksheet formula | CalcEngine API method |
Execution model | Declarative | Imperative |
Primary purpose | Evaluate multiple input combinations | Find an input value for a target result |
Returns | Dynamic array |
|
Modifies worksheet cells | No | Yes |
Topic | Description |
|---|---|
Syntax, parameters, and common usage patterns | |
Detailed rules for output size and input matching behavior | |
Controlling recalculation and monitoring progress | |
Import and export behavior and compatibility limitations | |
API reference and solving behavior |
In SpreadJS Designer, What‑If Analysis tools are available on the What‑If Analysis menu.
Options include:
Goal Seek
Data Table

For details about the Designer interface and configuration workflow, see What-If Analysis.