+ Reply to Thread
Results 1 to 10 of 10

Possible max value a cell can generate (given 2 variables)

  1. #1
    Registered User
    Join Date
    12-19-2018
    Location
    Hong Kong
    MS-Off Ver
    Excel 2016
    Posts
    74

    Possible max value a cell can generate (given 2 variables)

    In the worksheet, after three rows of calculations, we have the number in G2, determined by 2 variables in F2 and F3, for an analysis of constant data of A2:B17.

    The goal is to find the maximum value that G2 can possibly generate from all possible combinations of values in F2 and F3.
    The values in F2 and F3 when G2 is maximum are also important.

    How can we find the required values of F2, F3 and G2, and automate the finding process?
    If automation is too tedious, what will be the next best alternatives? Now I can only goal seek G2 by its theoretical maximum value 1 from variables F2 and F3 separately and alternatively to achieve solution.
    Any help would be very appreciated.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Possible max value a cell can generate (given 2 variables)

    I'm likely missing something, but how is G2 related to F2 and F3? How are F2 and F3 calculated?
    If someone helped achieve your solution, consider clicking "* Add Reputation" on their post.

    If your question has been answered, mark the thread as [SOLVED] using the Thread Tools menu at the top of the thread.

  3. #3
    Registered User
    Join Date
    12-19-2018
    Location
    Hong Kong
    MS-Off Ver
    Excel 2016
    Posts
    74

    Re: Possible max value a cell can generate (given 2 variables)

    Thanks for asking. F2 and F3 are two values attempting to define the "reasonable" range of A:B. They are not yet known until the calculation is finished. They are defined by the maximum value of G2.

    In turn, G2 is calculated and determined by F2 and F3. F2 and F3 influence the whole columns from C:C to E:E and finally G2 is the selected maximum of E:E, completing the calculation.

    Hope it's more clear now. Please ask if still not yet clear enough.

  4. #4
    Registered User
    Join Date
    12-19-2018
    Location
    Hong Kong
    MS-Off Ver
    Excel 2016
    Posts
    74

    Re: Possible max value a cell can generate (given 2 variables)

    Maybe it would be clearer to see the steps if F2 and F3 were placed before column C after column B.

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

    Re: Possible max value a cell can generate (given 2 variables)

    Is there a reason you are trying to use Goal Seek? Unless your version has something very different from mine, goal seek cannot find max/min -- it can only find a target value (basically a root finding problem like the other thread).
    For more complex problems, you will want to use Solver https://support.office.com/en-us/art...B-F63E45925040 In your spreadsheet, I:

    1) Called solver and told it to:
    2) Set Target cell: G2
    3) To a maximum
    4) By changing: F2:F3

    then clicked Solve to execute. It came back with a quick message that it had found a solution. I noted the values, then entered 20 in F2 and 50 in F3 and repeated the Solver command and it converged on the same maximum. As near as I can tell, Solver readily finds a solution. You have some "discontinuous" functions (IF(), MAX(), MIN()) inside of your calculation sequence, so it may be important to give Solver some good starting values so that it can find the maximum away from those "breaks" in the function. As near as I can tell, though, Solver can find a maximum for this problem.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Registered User
    Join Date
    12-19-2018
    Location
    Hong Kong
    MS-Off Ver
    Excel 2016
    Posts
    74

    Re: Possible max value a cell can generate (given 2 variables)

    wow, great help. I wouldn't know there's a solver solution, thanks. I used goal seek because I guessed when pretending to seek for the theoretical maximum, 1 (since it's impossible that G2>1), it will work towards the solution, but in that case I'd have to swap between F2 and F3.

    Now just like another goal seeking automation problem, can we make one step further and automate the solver process for this specifically, so that the solution would generate on its own given a correct combination of other equations? Thanks again.

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

    Re: Possible max value a cell can generate (given 2 variables)

    yes, it can be automated. In the other thread, you noted that you did not have the mathematical literacy to tackle Newton's method in 2 dimensions. I expect one could apply some multivariable calculus to this problem and get the solution, but I doubt we have the mathematical literacy to tackle the problem that way. Therefore, I expect that the easiest way to tackle this will be to explore automating Solver. As before, there will be a certain cost/benefit analysis in deciding how much time/effort to put into programming the automation against how much time/effort automation will save in the future.

    I rarely require high levels of automation for Solver. Solver is very good about remembering its settings. When I need to repeat a Solver run, I am two clicks away from manually repeating the Solver one: one click to call Solver (Solver remembers the target cell, by changing cell(s), etc. from previous use) and one click to press the Solve button. I rarely need more automation than that.

    Solver can be called through a VBA macro. I included a link to an example in my last post on the other thread. In addition, this tutorial contains a lot of information about calling Solver from VBA: https://peltiertech.com/Excel/SolverVBA.html Using these principles, one can reduce the two clicks (or more if Solver parameters need changing) down to one click to call the macro.

    If one is familiar with event procedures, one can call the Solver procedure from within a change or calculate event and have Solver run without input from the user. A couple of primers on event procedures:
    http://what-when-how.com/excel-vba/a...-in-excel-vba/
    http://www.cpearson.com/Excel/Events.aspx

    How far down the "automate Solver" rabbit hole do you want to go?

  8. #8
    Registered User
    Join Date
    12-19-2018
    Location
    Hong Kong
    MS-Off Ver
    Excel 2016
    Posts
    74

    Re: Possible max value a cell can generate (given 2 variables)

    Thank you for the detailed explanation. Does it mean that it's a higher level mathematical problem so we cannot just adjust, copy and paste a solution template of an excel like using the Newton's method in the earlier problem, and need to develop another combinations of equations for this particular problem, which is more difficult than automating Solver itself? Thanks again.

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

    Re: Possible max value a cell can generate (given 2 variables)

    Does it mean that it's a higher level mathematical problem so we cannot just adjust, copy and paste a solution template of an excel like using the Newton's method in the earlier problem, and need to develop another combinations of equations for this particular problem, which is more difficult than automating Solver itself?
    I would not say that we cannot do this by some algorithm like Newton's method. Extending Newton's method from 2 dimensions to 3 dimensions is definitely more complex. In the other thread, we noted that we did not have the mathematical literacy to fully understand and implement Newton's method in 2 dimensions. If we did not have that level of literacy, then we certainly do not have the literacy needed to implement something like Newton's method in 3 dimensions. Solver's programmers have already programmed Newton's method (and other algorithms) into the Solver utility.

    In short, without the mathematical literacy to program our own version of the algorithm, yes, it is easier to use their implementation.

  10. #10
    Registered User
    Join Date
    12-19-2018
    Location
    Hong Kong
    MS-Off Ver
    Excel 2016
    Posts
    74

    Re: Possible max value a cell can generate (given 2 variables)

    So it requires a 3-dimension application of Newton's method. I see. Seems manually using Solver is the best solution for now. Thanks for helping.

+ 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. Permuation of numbers in 4 variables to generate results
    By anuraggupta7 in forum Excel General
    Replies: 1
    Last Post: 04-12-2014, 03:28 PM
  2. Replies: 3
    Last Post: 06-10-2012, 11:02 AM
  3. Replies: 1
    Last Post: 01-09-2012, 12:14 PM
  4. Generate List based on specific Variables being Met
    By swankrain in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2010, 04:55 PM
  5. generate lists from datasheet with multiple variables
    By Sjaaktrekhaak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-19-2009, 08:03 AM
  6. Generate lagged dummy variables
    By tianyi86 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-30-2009, 01:28 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