+ Reply to Thread
Results 1 to 8 of 8

mimic goalseek

  1. #1
    Monique
    Guest

    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. #2
    Tom Ogilvy
    Guest

    Re: 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" <Monique@discussions.microsoft.com> wrote in message
    news:CD3C32F2-C06F-4DA1-BAD6-61494F135B69@microsoft.com...
    > 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. #3
    Monique
    Guest

    Re: 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" <Monique@discussions.microsoft.com> wrote in message
    > news:CD3C32F2-C06F-4DA1-BAD6-61494F135B69@microsoft.com...
    > > 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. #4
    Tushar Mehta
    Guest

    Re: mimic goalseek

    In article <CD3C32F2-C06F-4DA1-BAD6-61494F135B69@microsoft.com>,
    Monique@discussions.microsoft.com 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

  5. #5
    Tom Ogilvy
    Guest

    Re: mimic goalseek

    See Stephen Bullen's site:

    http://www.bmsltd.ie/Excel/SBXLPage.asp

    GoalSeek.zip (20 Aug 1996, 11k, 11343 downloads)
    The standard goal seek function in Excel is OK, but can not cope with large,
    complex spreadsheets. This is because it only does a simple recalc during
    each iteration, and can not cope with circular references. The routine in
    this file is a simple linear-interpolation goal seek written in VBA. The
    goal seek calls a separate calculation procedure during each iteration, in
    which you can include any code you like. For example, you could refresh a
    pivot table, filter a database, consolidate data, copy and paste etc.

    It is the 4th utility from the bottom.

    Stephen has actually moved his site to this URL:

    http://www.oaltd.co.uk/Excel/Default.htm

    but the first on still seems to work.

    the code in the download should be accessible.

    --
    Regards,
    Tom Ogilvy


    "Monique" <Monique@discussions.microsoft.com> wrote in message
    news:CA6231BB-2C13-485B-B864-D1B5914D3E24@microsoft.com...
    > 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" <Monique@discussions.microsoft.com> wrote in message
    > > news:CD3C32F2-C06F-4DA1-BAD6-61494F135B69@microsoft.com...
    > > > 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.

    > >
    > >
    > >







    Attached Images Attached Images

  6. #6
    Tom Ogilvy
    Guest

    Re: mimic goalseek

    Just to add:

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


    --
    Regards,
    Tom Ogilvy


    "Monique" <Monique@discussions.microsoft.com> wrote in message
    news:CA6231BB-2C13-485B-B864-D1B5914D3E24@microsoft.com...
    > 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" <Monique@discussions.microsoft.com> wrote in message
    > > news:CD3C32F2-C06F-4DA1-BAD6-61494F135B69@microsoft.com...
    > > > 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.

    > >
    > >
    > >




  7. #7
    Tushar Mehta
    Guest

    Re: mimic goalseek

    In article <O81ra9YqFHA.3768@TK2MSFTNGP10.phx.gbl>, twogilvy@msn.com
    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

  8. #8
    Monique
    Guest

    Re: 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" <Monique@discussions.microsoft.com> wrote in message
    > news:CA6231BB-2C13-485B-B864-D1B5914D3E24@microsoft.com...
    > > 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" <Monique@discussions.microsoft.com> wrote in message
    > > > news:CD3C32F2-C06F-4DA1-BAD6-61494F135B69@microsoft.com...
    > > > > 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.
    > > >
    > > >
    > > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1