Find Value of Cell Such That Two Other Cells Are Equal

JohnTravolski

New Member
Joined
Nov 25, 2015
Messages
45
Office Version
  1. 2019
Platform
  1. Windows
I have a spreadsheet with several complicated formulas and I'm wanting a cell B6 to display a value that would make two other cells equivalent (one of the cells depends on B6 and the other cell does not). I imagine it would have to be done using some numerical method, but I don't know if Excel can even do this at all. Take, for example, the following spreadsheet:

r/excel - Find Value of Cell Such That Two Other Cells Are Equal

The PV Factor column has the formula

Excel Formula:
=(1+$B$6)^(DATEDIF(F2,TODAY(),"d")/365)

and the "Expected Present Value" cell has the formula

Excel Formula:
=SUMPRODUCT(E:E,G:G)

while the "Actual Value" column was a manually-entered constant. I'm wanting to the find the value of the "Long Term Constant Return" that makes the cells "Actual Value" and "Expected Present Value" equal. Unfortunately, sumproduct is not an invertible function, so I cannot analytically solve for the Long Term Constant Return with a formula. I need to use some kind of numerical method to find an approximate answer, but I want Excel to do this for me automatically and display the result in a cell.

How can I have Excel calculate this value for me? I have attached the spreadsheet here: solve excel equation.xlsx
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi John.
Can it be set up to calculate that value automatically?
Using Solver, I don't know. If you are open to a bit of code in your project, we could automate the calculation of "Long Term Constant Return" by responding to a change in the "Actual Value" cell. Tell me what you think.
 
Upvote 0
Hi John.

Using Solver, I don't know. If you are open to a bit of code in your project, we could automate the calculation of "Long Term Constant Return" by responding to a change in the "Actual Value" cell. Tell me what you think.
Hi, I found a way to do it by calling "Goal Seek" in VBA. It still requires me to click a button in excel to run it, but it works well enough. This was the line I needed in VBA (the cells I reference here don't match my worksheet because that was just a simplified version, but it should be clear enough):
Range("C5").GoalSeek goal:=Range("E5").Value, ChangingCell:=Range("B22")
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,695
Members
448,979
Latest member
DET4492

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