Google Sheets What If Analysis: Guide and Examples
In this article
Google Sheets what-if analysis is the process of changing values in a cell to see how those changes affect the outcome of a formula. This allows you to explore different scenarios, determine the input needed to reach a specific goal, and visualize how multiple variables interact without manually recalculating every possibility. Because Google Sheets does not have a built-in "Scenario Manager" like Excel, users achieve these results through a combination of the Goal Seek add-on, data tables created with the TABLE function (via scripts or manual arrays), and strategic cell referencing.
What You'll Need
- A Google account with access to Google Sheets.
- A basic mathematical model already built in your sheet (e.g., a loan calculator, a budget, or a sales projection) where a "result" cell depends on one or more "input" cells.
- The "Goal Seek" add-on installed from the Google Workspace Marketplace (for reverse-calculation analysis).
Step-by-Step
Depending on your goal, you will use different methods. Below are the three most common ways to perform what-if analysis. Note that menu labels may differ slightly depending on your browser version or region.
Method 1: Using Goal Seek (Finding the Input for a Specific Result)
Use this when you know the result you want but don't know what input value is required to get there. For example, if you know you can afford a monthly payment of $500, Goal Seek can tell you the maximum loan amount you can borrow.
- Open your Google Sheet and ensure you have a formula that links an input cell (e.g., Loan Amount) to a result cell (e.g., Monthly Payment).
- Go to the Extensions menu > Add-ons > Get add-ons.
- Search for "Goal Seek" (the official one provided by Google), install it, and grant the necessary permissions.
- Once installed, navigate to Extensions > Goal Seek > Open. A sidebar will appear on the right.
- In the Set cell field, select the cell containing the formula (the result cell).
- In the To value field, type the exact number you want the result cell to reach.
- In the By changing cell field, select the cell containing the input value you want the tool to adjust. This cell must contain a number, not a formula.
- Click Solve. The tool will iterate through numbers until it finds the value that produces your desired result.
- Review the result and click OK to keep the value or Cancel to revert to the original number.
Method 2: Creating a Manual Data Table (Comparing Multiple Scenarios)
Use this when you want to see how changing one or two variables affects the outcome across a range of possibilities. Since Google Sheets lacks a native "Data Table" button, you create a grid of inputs and link them to your model.
- Set up your base model in one area of the sheet (e.g., Cells A1 through B3), where B3 is your final result formula.
- Create a table grid. In the top row (starting at D1), list the different values you want to test for your first variable (e.g., different interest rates: 3%, 4%, 5%).
- In the left column (starting at C2), list the different values for your second variable (e.g., different loan terms: 12, 24, 36 months).
- In the first cell of the results grid (D2), write a formula that references your base model's result cell (e.g.,
=B3). - To automate this without complex scripts, you can use the
ARRAYFORMULAor simply create separate small models for each row. However, the most practical "what-if" method for most users is to create a "Scenario Switch" using a dropdown menu. - Create a dropdown menu via Insert > Dropdown.
- Use an
IFSorVLOOKUPformula in your model's input cells that changes the value based on the selection in that dropdown (e.g., "Optimistic", "Conservative", "Worst Case").
Method 3: Sensitivity Analysis with a Single Variable
This is the simplest form of what-if analysis, used to see how a result changes as one specific input fluctuates.
- Identify the input cell you want to test.
- Create a list of potential values for that input in a new column.
- Next to the first value, write the formula for your result, but replace the reference to the original input cell with a reference to the first value in your new list.
- Drag the fill handle (the small blue square at the bottom-right of the cell) down to apply the formula to all the test values.
- Highlight the resulting data and go to Insert > Chart to visualize the trend (a line chart is usually best for sensitivity analysis).
Common Mistakes
- Referencing the wrong cell in Goal Seek: A common error is selecting the input cell in the "Set cell" field. Remember: "Set cell" is always the formula/result; "By changing cell" is always the raw number.
- Using formulas in the "By changing cell": Goal Seek cannot change a cell that contains a formula. It can only overwrite static numbers. If your input is currently a formula, you must convert it to a value first.
- Circular References: Creating a what-if table where the result cell accidentally references the table itself will cause a
#REF!error. Always keep your base model and your analysis table in separate areas of the sheet. - Ignoring Precision: Goal Seek stops when it gets "close enough" to the target. If you need extreme precision (e.g., 10 decimal places), the tool may stop slightly early.
Tips
- Color Code Your Inputs: To avoid accidentally deleting formulas during a what-if analysis, color all input cells (the ones you change) yellow and all formula cells (the ones that calculate) grey.
- Use Named Ranges: Instead of referencing
B3, name the cell "MonthlyPayment". This makes your what-if formulas much easier to read (e.g.,=MonthlyPayment * 12). - Protect Your Base Model: Before running extensive what-if scenarios, right-click your base model range and select View more cell actions > Protect range. This prevents you from accidentally overwriting your core logic while testing scenarios.
- Combine with Checkboxes: Use Insert > Checkbox to create "On/Off" switches for certain costs or revenues in your model, allowing you to instantly see the impact of adding or removing a specific expense.
Troubleshooting
If your what-if analysis is not producing the expected results, follow these steps in order:
- Check for Hard-Coded Numbers: Ensure your result cell is actually a formula. If you typed the result manually, Goal Seek and sensitivity tables will have nothing to calculate.
- Verify the Formula Chain: Trace the path from the input cell to the result cell. If there is a break in the chain (e.g., a cell in the middle is not linked), changing the input will have no effect on the output.
- Reset Goal Seek: If Goal Seek is stuck or giving an error, close the add-on sidebar and reopen it. Ensure the "By changing cell" is completely empty or contains a simple number.
- Check for Hidden Rows/Columns: Sometimes a what-if table appears empty because the results are being calculated in hidden rows or columns. Unhide all cells to verify the data.
- Update the Add-on: If the Goal Seek sidebar fails to load, check the Google Workspace Marketplace to ensure the add-on is updated or try reinstalling it.
Frequently Asked Questions
Can I do what-if analysis with multiple variables at once?
Yes, but not with Goal Seek, which only handles one variable. To analyze multiple variables, you should create a scenario table using a combination of VLOOKUP and a dropdown menu to switch between different sets of input values.
Is there a built-in Scenario Manager in Google Sheets?
No, Google Sheets does not have a dedicated Scenario Manager tool like Microsoft Excel. Users typically simulate this by creating separate tabs for different scenarios or using a dropdown menu to toggle input values.
Why does Goal Seek say it cannot find a solution?
This usually happens if the target value is mathematically impossible given the constraints of your formula, or if the "By changing cell" is not linked to the "Set cell" in a way that affects the outcome.
Can I use what-if analysis for non-financial data?
Absolutely. It is frequently used for project management (e.g., "How many more staff members do I need to finish the project by June?") or scientific modeling (e.g., "What temperature is needed to achieve this reaction rate?").
Does Goal Seek work on mobile devices?
Generally, no. Google Sheets add-ons, including Goal Seek, are typically only available on the desktop browser version of Google Sheets and do not function within the iOS or Android apps.