+ Reply to Thread
Results 1 to 3 of 3

Using goal-seek (or equivalent) from with a function

  1. #1
    Registered User
    Join Date
    03-10-2017
    Location
    West Midlands, England
    MS-Off Ver
    Microsoft Office Professional 2010
    Posts
    5

    Using goal-seek (or equivalent) from with a function

    A VBA function can't change cell values, but that's how Excel's "goal-seek" works. Therefore it would appear you can't use goal-seek from within a function.

    For my application, I want to code the goal-seek part as a function, not a macro or subroutine.

    Is there a built-in equivalent to goal-seek that doesn't break the functional paradigm (e.g. by using a variable instead of a cell) so that I may use it in the body of a function?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Using goal-seek (or equivalent) from with a function

    No; goal seek changes a cell to achieve a result in another cell, and there is no other native function that works with variables in lieu of range.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,925

    Re: Using goal-seek (or equivalent) from with a function

    Goal seek uses a basic Newton Raphson type algorithm, which is fairly easy to code from scratch. I have examples here (https://www.excelforum.com/tips-and-...ind-roots.html early posts focus on spreadsheet only implementations, the last past includes examples of a VBA implementation). See if that helps.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Automate Goal Seek Function
    By korny88 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-20-2016, 11:27 AM
  2. [SOLVED] vb- Seek Goal function
    By BenBen88 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-09-2016, 06:43 PM
  3. Goal Seek as a function?
    By valeous in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-12-2015, 08:51 PM
  4. Function Goal Seek
    By Amelia_T in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-13-2014, 08:48 PM
  5. Goal Seek Function - howto
    By yjohari in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-19-2013, 06:05 AM
  6. Creating a goal seek function
    By pqpine413 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-01-2011, 07:49 PM
  7. goal seek function
    By rdsouza in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2010, 05:46 PM

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