+ Reply to Thread
Results 1 to 4 of 4

Solver configuration for a fairly complex sheet.

  1. #1
    Registered User
    Join Date
    07-06-2022
    Location
    Helsinki, Finland
    MS-Off Ver
    O365
    Posts
    5

    Cool Solver configuration for a fairly complex sheet.

    Hi folks!

    I need 2 level ones to get 1 level two. 2 level twos to get 1 level three. 2 level threes to get 1 level four, and so on.
    Formula for number of level ones to get 1 of level N is: X = 2^(N-1).
    I got this built on a sheet and now I need to find minimum number of level ones to get 1 level N having certain numbers of level K's between level 1 and level N.

    I tried Goal Seek and it finds a solution but it's not minimum. Found out Goal Seek does not have feature to search for minimums.

    So I tried Solver. I set up objective and constraints but solution is not found. Instead I get Feasibility errors.

    I'm not familiar with Solver and my scenario might be erronous or maybe the sheet is too complex. Could someone please check the setup on workbook attached.

    Any help highly appreciated, thanks in advance
    Attached Files Attached Files

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

    Re: Solver configuration for a fairly complex sheet.

    I notice that G27 is an INT() function and E17 includes a ROUNDDOWN() function. These functions tend to make "step" functions (or something otherwise discontinuos). Solvers (especially GRG algorithms that are similar to the old Newton's method) do not work well if at all on discontinuous functions. If you must use Solver for this, you should probably rethink your objective and constraint functions and see if you can make them continuous functions.

    If you don't have to use Solver for this, I manually used a bisection algorithm to find a solution at G29=759. It only took a minute or so, it was tedious, but it was quick and easy. Would you be allowed to solve this manually outside of Solver? Of course, if you find a bisection or other algorithm reliable, it can be programmed into the spreadsheet or VBA without too much difficulty.

    One tool that might be useful for this is to set up a data table (https://www.excel-easy.com/examples/data-tables.html ). By setting up a data table, you can quickly calculate G27 and E17 at multiple different values for G29 and see approximately where the minimum value for G27 that still meets the E17=1 criteria.

    A couple of ideas. Let us know how we can help further.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Solver configuration for a fairly complex sheet.

    Using the Evolutionary solver engine and setting an upper and lower bounds on G29 i.e. G29<=1310 and G29=>0 solver seems to have no problem finding a solution to your problem.

    Alf
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor Hydraulics's Avatar
    Join Date
    07-15-2018
    Location
    Udine - Italy
    MS-Off Ver
    Office 365
    Posts
    370

    Re: Solver configuration for a fairly complex sheet.

    Since you already know the result you want to achieve, (given by the "constraints" for Solver), we can build the solution working from top to bottom.

    At the highest level, we set a 1 in U17. After that, at each step, we take into account the given owned and extra quantities like this

    =IF(T18=0,(U17-B17-C17)*2,T18)

    having copied the constraints in column T.

    Changing the level of the starting 1, results are the same you get from the table (just copy U29 to G29).

    HTH,

    Francesco
    Attached Files Attached Files
    Aim high or don't even try.
    ---------------------------------
    If your question has been answered, don't forget to mark the thread as SOLVED.
    If you find an answer helpful, click on the star icon at the bottom of the post.

+ 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. Replies: 1
    Last Post: 04-01-2020, 04:56 PM
  2. Fairly complex - matching "siblings" and "parents" across sheets
    By michael.sejrup in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-09-2016, 01:24 AM
  3. Solver - complex functionality
    By Adsup01 in forum Excel General
    Replies: 5
    Last Post: 10-27-2016, 08:29 AM
  4. Configuring a pivot from an unknown configuration to desired configuration
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-10-2015, 11:14 AM
  5. Replies: 3
    Last Post: 04-23-2013, 06:49 PM
  6. I keep getting random bugs in a fairly complex code (for me neways)... works sometimes tho
    By Legend Rubber in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2013, 08:39 AM
  7. Fairly Complex IF Statement
    By Patrick in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-09-2005, 05:06 PM

Tags for this Thread

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