Skip to content

Lesson 32 of 92 · Free Excel Course

Excel

What-If Analysis in Excel: Goal Seek, Scenario Manager, Data Tables, Solver and FORECAST

Use Goal Seek, Scenario Manager, data tables, Solver and FORECAST.LINEAR on one car-loan model, step by step. Free practice workbook with answer key.

"What if the car cost less? What if I put more money down? What if the rate goes up?" Excel has a set of tools built for exactly these questions, called what-if analysis. Goal Seek works backwards from the answer you want. Scenario Manager saves whole sets of inputs so you can flip between them. Data tables show dozens of results side by side. Solver finds the best answer within limits you set. And FORECAST.LINEAR looks at past numbers to estimate the next ones. This lesson uses one small car-loan model for all of them, so you can check every number.

The model we'll test

Every what-if tool needs the same thing: input cells holding plain numbers, and a formula that uses them. Here's the model on the Practice sheet of the workbook:

B6=PMT(B4/12,B5*12,-B3)
AB
1Car price$32,000.00
2Down payment$7,000.00
3Loan amount$25,000.00
4Annual interest rate6.90%
5Loan length (years)5
6Monthly payment$493.85
7Total interest$4,631.08
Inputs in B1, B2, B4 and B5. B3 is =B1-B2, B6 works out the payment and B7 is =B6*B5*12-B3.

PMT divides the yearly rate by 12 and multiplies the years by 12 because the payments are monthly. The minus in front of B3 makes the payment show as a positive number. (The loan and finance formulas lesson explains PMT and its sign rules in full.)

All the what-if tools on Windows are in one place: the Data tab, Forecast group, What-If Analysis button. It holds Scenario Manager, Goal Seek and Data Table. Solver and Forecast Sheet sit next to it once they're available. Quick tip: on Windows, Alt, A, W, G opens Goal Seek from the keyboard.

Goal Seek: work backwards from the answer

You can afford $450 a month. What's the most the car can cost? Instead of guessing prices, let Goal Seek find it:

  1. Click B6, the payment formula.
  2. On the Data tab, click What-If Analysis, then Goal Seek.
  3. Set cell: B6 (already filled in, because you clicked it).
  4. To value: 450.
  5. By changing cell: B1, the car price.
  6. Click OK. Excel tries values until B6 hits 450, then reports that it found a solution.
  7. Click OK to keep the new value, or Cancel to put the old one back.
B129780.1360236229
AB
1Car price$29,780.14
2Down payment$7,000.00
3Loan amount$22,780.14
4Annual interest rate6.90%
5Loan length (years)5
6Monthly payment$450.00
7Total interest$4,219.86
After Goal Seek: a $29,780.14 car keeps the payment at exactly $450. Goal Seek typed a value into B1; it doesn't leave a formula.

You can prove it: =7000+PV(6.9%/12,60,-450) also gives $29,780.14. That's the down payment plus the loan that $450 a month pays off in five years.

Goal Seek has two limits. It changes one cell only, and it overwrites that cell with a number. If you click OK by mistake, press Ctrl+Z (Cmd+Z on a Mac) to get $32,000 back. On a Mac the steps are the same: Data, What-If Analysis, Goal Seek.

Scenario Manager: save and compare whole sets of inputs

You're weighing three plans: the base deal, a bigger $10,000 down payment, and a six-year loan at 7.4%. Scenario Manager stores each plan and builds a comparison report.

  1. Go to Data, What-If Analysis, Scenario Manager, and click Add.
  2. Scenario name: Base. Changing cells: B1,B2,B4,B5 (hold Ctrl and click them). Click OK.
  3. Excel shows the current value of each cell. Leave them as they are and click OK. Save your starting values as a scenario first, so you can always get back to them.
  4. Click Add again for Bigger down payment (change B2 to 10000), and again for Longer loan (B4 to 0.074 and B5 to 6).
  5. Pick a scenario in the list and click Show to put its values into the sheet.
  6. Click Summary, choose Scenario summary, type B6,B7 as the Result cells, and click OK.

Excel adds a Scenario Summary sheet:

ABCD
1Scenario SummaryBaseBigger down paymentLonger loan
2Changing Cells:
3$B$1$32,000.00$32,000.00$32,000.00
4$B$2$7,000.00$10,000.00$7,000.00
5$B$46.90%6.90%7.40%
6$B$5556
7Result Cells:
8$B$6$493.85$434.59$431.04
9$B$7$4,631.08$4,075.35$6,035.11
The summary (simplified). The longer loan has the lowest payment but costs about $1,400 more interest than the base deal.

Excel also adds a "Current Values" column; name your input cells (for example Price) and the report shows names instead of $B$1. A scenario can change up to 32 cells. The summary is a snapshot: it doesn't update when you edit a scenario, so make a new one. Choose Scenario PivotTable report instead if you want a pivot (you must give result cells for that).

Data tables: see many answers at once

Goal Seek gives one answer. A data table fills a grid with the result for every input you list.

One-variable data table (payment at seven different rates):

  1. In D4:D10 type the rates 5%, 5.5% and so on up to 8%.
  2. In E3, one row above and one column right of the first rate, type =B6.
  3. Select D3:E10.
  4. Go to Data, What-If Analysis, Data Table.
  5. Leave Row input cell empty. In Column input cell type B4 (the rate cell), because your rates run down a column. Click OK.

E4:E10 now shows $471.78 at 5% up to $506.91 at 8%.

Two-variable data table (rates down, loan years across):

  1. Put the formula =B6 in the top-left corner, D13.
  2. Type years 3, 4, 5, 6 across E13:H13 and rates 5%, 6%, 6.9%, 8% down D14:D17.
  3. Select D13:H17 and open Data Table again.
  4. Row input cell: B5 (years are in the row). Column input cell: B4 (rates are in the column). Click OK.
F16{=TABLE(B5,B4)}
DEFGH
13$493.853456
145.00%$749.27$575.73$471.78$402.62
156.00%$760.55$587.13$483.32$414.32
166.90%$770.78$597.50$493.85$425.03
178.00%$783.41$610.32$506.91$438.33
Every payment for 16 rate-and-term combinations. Each result cell holds the same {=TABLE(B5,B4)} formula.

The 6.9%, 5-year cell matches B6, a good check that you put the input cells the right way round. Swap them by mistake and the numbers come out wrong without any warning. The answer key reproduces this grid with ordinary PMT formulas, so you can compare cell by cell.

Large data tables can slow a workbook down. File, Options, Formulas, then Automatic except for data tables stops them recalculating each time; press F9 to update them. On a Mac it's the same command: Data, What-If Analysis, Data Table.

Solver: the best answer within limits

Goal Seek finds one exact value. Solver can find the largest or smallest result while changing several cells and obeying rules. It's a free add-in, so switch it on once:

  1. Windows: File, Options, Add-ins. In the Manage box choose Excel Add-ins and click Go.
  2. Tick Solver Add-in and click OK. Solver appears on the Data tab, in the Analysis group at the right end.
  3. Mac: Tools, Excel Add-ins, tick Solver Add-In, OK. The Solver button appears on the Data tab.

The question: what's the most expensive car you can buy if the payment stays at or below $450, you can put down at most $8,000, and the loan is 3 to 6 whole years?

  1. Click Data, Solver.
  2. Set Objective: $B$1. To: Max.
  3. By Changing Variable Cells: $B$1,$B$2,$B$5.
  4. Click Add for each constraint: $B$6 <= 450, $B$2 <= 8000, $B$5 >= 3, $B$5 <= 6, and $B$5 int (whole number).
  5. Select a Solving Method: GRG Nonlinear (PMT isn't a straight-line formula).
  6. Click Solve, then Keep Solver Solution and OK.

Solver puts down the full $8,000, stretches the loan to 6 years, and sets the price to $34,468.99. Check it: =8000+PV(6.9%/12,72,-450) gives the same. Whether a 6-year loan is wise is another matter: see the interest in the scenario summary.

Solver can change up to 200 cells. Simplex LP suits purely linear models, Evolutionary suits rough ones. Solver doesn't run in Excel for the web, because the web version doesn't support this kind of add-in, and it isn't on phones or tablets.

FORECAST.LINEAR and Forecast Sheet: estimate future values

The other tools answer "what if I change this input?" Forecasting answers "if things carry on like this, what comes next?" The Sales sheet lists cars sold each month in 2026.

B14=FORECAST.LINEAR(A14,$B$2:$B$13,$A$2:$A$13)
AB
9MonthCars sold
10Sep 202655
11Oct 202659
12Nov 202662
13Dec 202664
14Jan 202765.3
15Feb 202767.3
16Mar 202769.1
The last four months of real sales, then three forecasts. Row 9 is the header for this view; on the sheet, the data starts in row 2.

The syntax is =FORECAST.LINEAR(x, known_y's, known_x's):

  • x is the point you want a value for: the date in A14.
  • known_y's are the past results: $B$2:$B$13.
  • known_x's are their dates: $A$2:$A$13. Lock both ranges with $ so you can fill the formula down.

It draws the best straight line through the 12 months and reads off January (65.3 cars), February (67.3) and March (69.1). The older FORECAST function gives identical results. It returns #N/A if the two ranges are different sizes. The function works on Windows, Mac and Excel for the web.

Forecast Sheet does this with a chart and a confidence range, using FORECAST.ETS, which can also pick up seasonal patterns:

  1. Select the dates and values (A1:B13).
  2. On the Data tab, in the Forecast group, click Forecast Sheet.
  3. Choose a line or column chart, set Forecast End, and open Options for the confidence interval (95% by default) and seasonality.
  4. Click Create. Excel adds a new sheet with a table and chart.

The dates need to be evenly spaced: daily, monthly or yearly. Forecast Sheet is in Excel for Windows; Excel for Mac and Excel for the web don't have the button, so use FORECAST.LINEAR there.

Which tool should I use?

Your questionTool
What input gives me exactly this result?Goal Seek
How do three or four complete plans compare?Scenario Manager
What's the result for every value in a list (or two lists)?Data table
What's the best result, given limits?Solver
What comes next if the trend continues?FORECAST.LINEAR or Forecast Sheet

Try it yourself

Download the practice workbook. The Your task sheet has the steps; the Practice sheet has the car-loan model and empty data-table grids, and the Sales sheet has the monthly sales.

  1. Goal Seek B6 to 450 by changing B1 ($29,780.14), then put B1 back to 32000.
  2. Add the three scenarios, make a Scenario summary with result cells B6,B7, then Show the Base scenario.
  3. Build the one-variable table in D3:E10 (Column input cell B4).
  4. Build the two-variable table in D13:H17 (Row input B5, Column input B4).
  5. Load Solver and maximise B1 with the five constraints ($34,468.99).
  6. On Sales, fill =FORECAST.LINEAR(A15,$B$2:$B$13,$A$2:$A$13) into B15:B17.

The Answer key has every expected result, with PMT, PV and FORECAST.LINEAR formulas that prove them. Open the file in the desktop app: Excel for the web can't build data tables, scenarios or Solver models.

Common mistakes

  • Wrong sign in Goal Seek. If your payment formula shows a negative number, type -450 as the To value, not 450.
  • Pointing Goal Seek at a value. The Set cell must be a formula, and the By changing cell must be a plain number the formula depends on.
  • Forgetting to undo. Goal Seek and Solver leave new numbers in your inputs. Save a Base scenario first, or press Ctrl+Z.
  • Swapped input cells. In a two-variable table, Row input cell goes with the values across the top. Check one result against your model.
  • Editing one data-table cell. Excel says you can't change part of a data table. Change the inputs, or delete the whole result block.
  • Trusting an old summary. Scenario summaries don't update. Rebuild them after editing scenarios.
  • Forecasting from too little data. A straight line through five points is a guess. Use as much clean history as you have.

What's next

You can now ask "what if" five different ways and check every answer. The previous lesson, Power Query and Power Pivot, covers getting big data into shape. Next, Loan and finance formulas explains PMT, RATE, NPER and the rest, and builds a full amortization schedule for this same $25,000 loan. Want a quick answer without a spreadsheet? Try the free loan calculator. Or go back to the full Excel course.

Frequently asked questions

What is the difference between Goal Seek and Solver?

Goal Seek changes one input cell until one formula hits the exact value you type. Solver can change many cells at once (up to 200), can find the biggest or smallest possible result instead of an exact one, and lets you add rules such as "payment must be $450 or less" or "years must be a whole number". Start with Goal Seek; switch to Solver when you have more than one input or need limits.

How do I add Solver to Excel?

On Windows go to File, Options, Add-ins, choose Excel Add-ins in the Manage box and click Go. Tick Solver Add-in and click OK. Solver then appears at the right end of the Data tab, in the Analysis group. On a Mac use Tools, Excel Add-ins, tick Solver Add-In and click OK. Solver doesn't run in Excel for the web.

Why can't I change part of a data table?

The results of a data table are one block filled by a single `{=TABLE()}` formula, so Excel won't let you edit or delete just one cell of it. To change the inputs, type new values in the row or column of inputs and the results update. To get rid of the table, select all the result cells and press Delete.

Can I use Goal Seek in Excel for the web?

Not at the moment. Goal Seek, Scenario Manager, data tables and Solver are built in the Excel desktop app for Windows or Mac. In Excel for the web, use Open in Desktop App (or Open in Excel) to switch to the app. Workbooks with a data table or saved results still open and show their numbers on the web.

What's the difference between FORECAST, FORECAST.LINEAR and FORECAST.ETS?

FORECAST and FORECAST.LINEAR do the same thing: they fit a straight line through your past numbers and read off a future value. FORECAST.LINEAR is the newer name (Excel 2016 and later) and FORECAST stays for older files. FORECAST.ETS uses exponential smoothing, which can pick up seasonal ups and downs; it's what the Forecast Sheet button uses.

Why didn't Goal Seek find an answer?

Check three things. The Set cell must contain a formula, and that formula must depend (directly or through other cells) on the By changing cell. The By changing cell must hold a plain number, not a formula. And the target must be possible: no car price makes a payment negative. If it still fails, type a starting value closer to the answer and run it again.