ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   mimic goalseek (https://www.excelbanter.com/excel-programming/338314-mimic-goalseek.html)

Monique

mimic goalseek
 
I need to write a function that will mimic the function of goalseek.

I cannot use .goalseek in my code for other platforms cannot support.

If anyone could help me... it would be appreciated.

Tom Ogilvy

mimic goalseek
 
Just keep substituting values (incrementing your start value) until your
function achieves the goal (within a tolerance), or you reach some limit in
the number of increments. I don't think goalseek is any smarter than that.

--
Regards,
Tom Ogilvy

"Monique" wrote in message
...
I need to write a function that will mimic the function of goalseek.

I cannot use .goalseek in my code for other platforms cannot support.

If anyone could help me... it would be appreciated.




Monique

mimic goalseek
 
OK.

Right now, an input box appears. The user types in a number.
The number the user inputs is the goal that I want to affect the Price.

if i used goalseek, it would look like:

range("W42").goalseek goal:=newCV, changingcell:=range(price)

i don't have a set number of iterations. i just want it to reach the goal as
close as possible and update the cell at the end.

Can you please help me?



"Tom Ogilvy" wrote:

Just keep substituting values (incrementing your start value) until your
function achieves the goal (within a tolerance), or you reach some limit in
the number of increments. I don't think goalseek is any smarter than that.

--
Regards,
Tom Ogilvy

"Monique" wrote in message
...
I need to write a function that will mimic the function of goalseek.

I cannot use .goalseek in my code for other platforms cannot support.

If anyone could help me... it would be appreciated.





Tushar Mehta

mimic goalseek
 
In article ,
says...
I need to write a function that will mimic the function of goalseek.

I cannot use .goalseek in my code for other platforms cannot support.

If anyone could help me... it would be appreciated.

I am curious as to what are the platforms that support XL VBA but not
goalseek. ;-)

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

Tom Ogilvy

mimic goalseek
 
Just to add:

goalseek uses the setting in the Iterations section of
tools=Options=Calculation.


--
Regards,
Tom Ogilvy


"Monique" wrote in message
...
OK.

Right now, an input box appears. The user types in a number.
The number the user inputs is the goal that I want to affect the Price.

if i used goalseek, it would look like:

range("W42").goalseek goal:=newCV, changingcell:=range(price)

i don't have a set number of iterations. i just want it to reach the goal

as
close as possible and update the cell at the end.

Can you please help me?



"Tom Ogilvy" wrote:

Just keep substituting values (incrementing your start value) until your
function achieves the goal (within a tolerance), or you reach some limit

in
the number of increments. I don't think goalseek is any smarter than

that.

--
Regards,
Tom Ogilvy

"Monique" wrote in message
...
I need to write a function that will mimic the function of goalseek.

I cannot use .goalseek in my code for other platforms cannot support.

If anyone could help me... it would be appreciated.







Tushar Mehta

mimic goalseek
 
In article ,
says...
Just keep substituting values (incrementing your start value) until your
function achieves the goal (within a tolerance), or you reach some limit in
the number of increments. I don't think goalseek is any smarter than that.


{shudder} I hope you are wrong. {grin}

In any case, if one wanted to implement a "simple" goalseek algorithm,
I'd recommend looking at, in addition to Stephen's code,

Newton's Method
http://mathworld.wolfram.com/NewtonsMethod.html
and
Numerical Recipes' 5.7 Numerical Derivatives
http://www.library.cornell.edu/nr/bookcpdf/c5-7.pdf

Of course, I haven't seen Stephen's code. It may already incorporate
the ideas from Numerical Recipes. ;-)

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

Monique

mimic goalseek
 
Thanks so much. This is very helpful.

"Tom Ogilvy" wrote:

Just to add:

goalseek uses the setting in the Iterations section of
tools=Options=Calculation.


--
Regards,
Tom Ogilvy


"Monique" wrote in message
...
OK.

Right now, an input box appears. The user types in a number.
The number the user inputs is the goal that I want to affect the Price.

if i used goalseek, it would look like:

range("W42").goalseek goal:=newCV, changingcell:=range(price)

i don't have a set number of iterations. i just want it to reach the goal

as
close as possible and update the cell at the end.

Can you please help me?



"Tom Ogilvy" wrote:

Just keep substituting values (incrementing your start value) until your
function achieves the goal (within a tolerance), or you reach some limit

in
the number of increments. I don't think goalseek is any smarter than

that.

--
Regards,
Tom Ogilvy

"Monique" wrote in message
...
I need to write a function that will mimic the function of goalseek.

I cannot use .goalseek in my code for other platforms cannot support.

If anyone could help me... it would be appreciated.








All times are GMT +1. The time now is 01:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com