how this GoalSeek function works???

  • hello world,


    i was wondering how excel function GoalSeek which is used for equation solving is implemented!! i found no info on the web unfortunately :( please help if anyone knows

    just imagine

  • as an example say we have a regression equation y = mx + b where m = 3 and b = 100 and we want to know what value of x will give us a value for y = 300. Enter the formula =3*A1 +100 in cell B1 and in cell A1 enter 1. Then go to Tools -> Goal Seek and select cell B1 (our formula) as the Set Cell, equal to 300 by changing cell A1

  • perhaps i was a little unclear,
    but what i really need is a piece of vb (or whatever) code that implements exactly what GoalSeek function does! i guess MS don't share such information, but if you at least have a hint to which method it uses, i would appreciate that. the reason for my question is that we've got Excel and custom program performing the same calculations, an the results match exactly except for the point where GoalSeek is used. perhaps this function is unsuitable, perhaps there's a bug in our function.

    just imagine

  • I don't know how it works, I can only guess but it seems to be an interative one-dimensional algorithm. If you want to be sure that the result is the same, you can add the goal seek tool in your VBA function: e.g. if you want the formula in D6 to become equal to 2.2 by changing the cell in D7, you can use something like this:


    Range("D6").GoalSeek Goal:=2.2, ChangingCell:=Range("D7")