Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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.








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Goalseek Macro Ken G.[_2_] Excel Discussion (Misc queries) 5 June 13th 09 01:16 PM
How do I set a goalseek value via an input box using vba macro TJK Excel Worksheet Functions 1 August 23rd 07 09:18 PM
Goalseek Excel 2007 Gerry Verschuuren Excel Discussion (Misc queries) 1 February 7th 07 11:12 AM
GoalSeek in VBA [email protected] Excel Discussion (Misc queries) 1 July 20th 06 05:13 AM
Goalseek / Solver Target Value msnews.microsoft.com Excel Worksheet Functions 1 December 2nd 05 01:41 PM


All times are GMT +1. The time now is 06:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"