简体   繁体   中英

Get excel to continually 'goal seek'

I have a spreadsheet with numerous inputs, but one output (a price).

I want to get excel to automatically update one of the inputs (call it input 1) in order to keep the price constant whilst I adjust the other inputs.

I know 'goal seek' can do this, but I don't want to have to rerun the goal seek everytime I adjust another input. I particularly do not want to have to do this because I want to use scenario analysis to adjust the other inputs individually, and see how input 1 would need to change in order to keep the output (price) constant.

Someone asked a similar question here: Need Excel Goal Seek Logic

However there is no useful answer given to that post.

Would be most appreciative if anyone could help out please.

Thanks,

Timothy

You can write a VBA function calling the Range.GoalSeek method, in the Worksheet_Change event. When you change another cell, the goal seek code should run automatically.

Here is documentation on that method: http://msdn.microsoft.com/en-us/library/office/bb209907(v=office.12).aspx

如果可以将方程设置为在固定点迭代下收敛,则可以使用循环引用自动求解方程。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM