VBA Scenario Testing in a financial model

derek784

New Member
Joined
Jun 1, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
So I'm new to VBA and trying to automate my financial models. I've got this large complex stock valuation model on excel that reads either string bear, bull, or base from a single cell that has a dropdown that has the options of bear, bull, or base. The model will use different inputs depending on if the user chooses the strings bear, bull, or base, and the model will output different values of the stock respectively. In a separate sheet, I'm trying to display, in 3 separate cells, the output of the model (the value of the stock) in the bear, bull, and base case respectively. I could just make 3 models; a bear, bull, and base case, but I thought that might be too bulky, and I just want 1 dynamic model, instead of 3 models (one for each case). I'm wondering if VBA allows for a "scenario" type of ability in which it sets a specific cell to a hypothetical value and then takes the value of another cell. Basically, I wish to take the hypothetical outputs without actually having to change the inputs of my model.

If that was confusing, let's say I have sheets 1 and 2. On sheet 1 I have a financial model (which we can use x+10 = y as an analogy, where x is the input and y is the output). x can be a bull, bear, or a base, which let's say are 3,1, and 2 respectively. therefore the outputs y will be 13, 11, and 12 based on which of the 3 cases I choose. on sheet 2, im trying to display the outputs of the bear, bull, and base case (11, 13, and 12), without actually changing the model. Of course, a solution is just to make a bear, bull, and base case model, so that each has its own input and output, and I can just display the output from each of those models. But right now I want to do it with just 1 dynamic model, where I can make changes that will automatically translate into sheet 2. I tried scenario analysis, but the pivot chart/summary output is static, like it doesn't automatically update when I change the input values. note that the actual value for bear, bull, and base case can be changed to any number the user wants, so I couldn't just go bull=base+1.

In the photos I attached, in the first one, the highlighted cell is where I can change the string to be bear, bull, or base. In the 2nd photo, it would change the model and the output I'm looking for is the intrinsic value, found on the top right. The third photo shows that on another sheet, I wish to display the bull, bear, and base case intrinsic value results.
 

Attachments

  • Capture.PNG
    Capture.PNG
    49 KB · Views: 16
  • Capture.PNG
    Capture.PNG
    52.4 KB · Views: 15
  • Capture.PNG
    Capture.PNG
    4.9 KB · Views: 14

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,215,356
Messages
6,124,471
Members
449,163
Latest member
kshealy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top