+ Reply to Thread
Results 1 to 14 of 14

Solver doesn't find maxium revenue

  1. #1
    Registered User
    Join Date
    10-03-2015
    Location
    Frankfurt, Germany
    MS-Off Ver
    2010
    Posts
    6

    Solver doesn't find maxium revenue

    Hi Experts,

    I'm looking for the maximum revenue. I have already setup everything in the following excel.
    (If there are formulas with WENN replace them with IF but there shouldn't.)
    To the row C (Origin) I would like to add or subtract values according to the min and max values in the row a and b, but only that much that the gap between to values is a max of 25 (or -25).

    The values should be added or subtracted by the prices. Negativ prices should suggest to subtract and positiv to add.
    The value which is add or subtracted and the prices equal the revenue.
    All revenue in the sum should be maximized.

    It's complicated to write, but If you see the excel you should understand what I mean.

    To solve the problem I have used the solver.

    It should maximized the cell H10.
    For the any infringement of rules its if check Cell E10 = 0.
    And the values which should be add on or subtracted are in the cells D2 to D9

    The solver finds a result, but not the maximum.
    I want to find the maximum.

    Do you see any mistakes or should I solve this problem in a other way.

    Thanks for help

    Surminder
    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,827

    Re: Solver doesn't find maxium revenue

    In 9 dimensional space, it can be difficult to visualize the peaks and valleys and ridges (thinking in terms of 3D topography like on a topographic map) of your profit function. My guess is that, as currently formulated, your function has many peaks and valleys. The standard, default algorithms (Newton Raphson type algorithms if you are familiar) "go uphill" until they cannot go uphill any more. This is effective at finding a peak, but it can find a local maximum that may or may not be the global maximum. The solution in these cases is to understand your function and solution well enough to make better initial guesses.

    The evolutionary algorithm available as an option may do a better job at finding "the tallest peak among several peaks".

    I tend to test an algorithm/spreadsheet like this on problems where I know the final result. Do you know what your final, absolute maximum should be? I also find it useful to study my functions enough so that I know how they behave whether they have multiple maxima and other behaviors.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    10-03-2015
    Location
    Frankfurt, Germany
    MS-Off Ver
    2010
    Posts
    6

    Re: Solver doesn't find maxium revenue

    Hi,

    normally my collegues and I try manuelly to find the maximum, by just looking at prices and trying out.

    Therefore it was my idea to automazied it.

    But I'm not that fit in math to figure out a formular.

    So I don't know what the maximum is.

    For this example in the excel the maximum should be by trying out:

    Revenue: 649,51
    D2: -24,83
    D3: 24,99
    D4: 49,99
    D5: 74,99
    D6: 50
    D7: 74,99
    D8: 50
    D9: 25

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

    Re: Solver doesn't find maxium revenue

    Interesting. Using Solver and starting values of 40 for D2 and 60 for D3:D9, I get a maximum of ~655.5 with the following values in D:
    34.44
    65.56
    68.33
    73.89
    48.89
    73.89
    51.67
    60
    I cannot be certain that this is the absolute maximum without taking a good deal of time to further study the function. The Evolutionary algorithm is not available in my version (2007), so you might try the evolutionary algorithm if you have not yet tried it. You indicate that you are "not that fit" in math, but I would suggest you spend time with different values and try to understand the behavior of the function until you can better understand where the maxima occur and how to better use Solver to find the maximum.

  5. #5
    Registered User
    Join Date
    10-03-2015
    Location
    Frankfurt, Germany
    MS-Off Ver
    2010
    Posts
    6

    Re: Solver doesn't find maxium revenue

    The evolutionary algorithm doesn't shows the maximum either or even the other options.

    But by seeing your result I see that there is even a much higher revenue possible.

    Revenue: 724,6

    25,2
    75
    75
    75
    50
    75
    50

    So I think the solver wouldn't help here. Maybe problem should be should with vba or in an other way?

  6. #6
    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: Solver doesn't find maxium revenue

    Why is col G used in the calculation for col H when it's blank?
    Entia non sunt multiplicanda sine necessitate

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

    Re: Solver doesn't find maxium revenue

    I'm not sure that VBA is going to be better at this point, because VBA does not have any "magical" algorithms preprogrammed in it that are better than Solver's algorithms. VBA may be a better solution after we have figured out a suitable, reliable algorithm for finding the maximum. It seems to me that, at this point, we are just "guessing". Solver will work just fine for "just guessing". We "guess some starting values, let Solver find the maximum from those starting values, then guess another set of starting values and let Solver run, and keep doing that until we have decided that we have found the maximum. VBA could automate this kind of "guess and check" method, but I'm not sure how many loops we would need before we would be confident that we have found the one and only maximum.

    I think this needs more math work outside of Excel. The profit function seems simple enough. I think column H can be simplified to =F2*D2, and the profit is simply the sum of these products. It seems to me that the maximum is going to occur where we can add the most of row 5 and 8 while adding the least from row 2 6 and 9. Your constraint in column E does not make much sense to me, but I suspect that the constraint is going to have the biggest impact on the maximum, because that is where the real maximization occurs. I would probably spend some time outside of Excel understanding how this constraint/check column and the revenue column are related. From this work, I would probably formulate a new objective function that can better account for the relationship between the constraint and the revenue. Then, with that objective function in the spreadsheet, run Solver to find the maximum. I expect that, when you have a well formulated objective function, Solver's algorithms should have little difficulty finding the maximum.

  8. #8
    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 doesn't find maxium revenue

    Testing with the same starting value as MrShorty I get similar values in the D column but maximum is 646,38
    D column values.
    37,53
    65,56
    68,33
    73,89
    48,89
    73,89
    51,67
    60,00

    Based on this I did a run with the Evolutionary model, without no lower and upper limits this did not work so based on the previous result I set 35 as the lower and 70 as the upper limmit and I got a solution that solver could not improve on. Maximum was 664,99
    and D column values
    35,00
    70,00
    70,00
    70,00
    45,00
    70,00
    45,00
    43,58
    but i don't know enough to see if this makes sence or not.

    Alf

  9. #9
    Registered User
    Join Date
    10-03-2015
    Location
    Frankfurt, Germany
    MS-Off Ver
    2010
    Posts
    6

    Re: Solver doesn't find maxium revenue

    ups - normally you would add values when there are prices above 50 and with the pricegap you would calculate the revenue.

    But I thought that is extra stuff which is not necessary to solve the problem and just makes it more complicated. So I changed the prices ratio too positive to add and negativ to decrease.

    But forgot to delete the col g. sorry - but it has know effect on the calculation.

    Here a version without col g - but like I said it basically the same
    Attached Files Attached Files

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

    Re: Solver doesn't find maxium revenue

    As an example of the kind of analysis I think would be more valuable here.

    Since row 5 and 7 have the highest price, and the "detractors" (rows 6 and 8) do not take away as much as 5 and 7 add, it seems like the maximum should be one where these two are at maximum (135-60=75). Now, in order to meet the criteria, you need to add the smallest amount to rows 6 and 8 (135-25=110, 110-60=50, so 50 goes in these rows). Working up from there, row 4 has a positive price, and both rows above and below row 4 also have a positive price, so this one should also be maximized (135-60=75). Row 3 has a positive price, but row 2 above it has the opposite (negative) price. So, as long as row 3 meets the criteria determined by row 4 (50 to 75) and row 2 is set to a minimum relative to row 3 (so that total row 2 comes out 25 less than row 3), row 2 and row 3 will cancel each other out and have no effect on the final result. This analysis leads to the solution you suggested in post #5, amongst other possible solutions.

    I think what this analysis suggests is that, rather than a NR type algorithm, and algorithm that can look at price (maybe a three row moving average of price and/or and overall average price) and see that, when average price is positive, move positive prices to "maximum, then minimize the "detractors" relative to those maxima. A scenario where average price is negative would probably suggest first minimizing all of the negative prices, while maximizing the the positives relative to those negatives. If we can prove to ourselves that this kind of algorithm works, then we can use the appropriate spreadsheet formulas to optimize different scenarios without using Solver. This kind of analysis is looking more at what is going on in the price and constraint columns than in the final revenue column.

  11. #11
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Solver doesn't find maxium revenue

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    http://www.excelguru.ca/forums/showt...maxium-revenue

  12. #12
    Registered User
    Join Date
    10-03-2015
    Location
    Frankfurt, Germany
    MS-Off Ver
    2010
    Posts
    6

    Re: Solver doesn't find maxium revenue

    ooh I'm really sorry.

    I new in forums (Join date 10-03-2015) and didn't noticed the problems of cross posting.

    Sorry.

  13. #13
    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 doesn't find maxium revenue

    Looking at the formula for your revenue calculation I do wonder how this affects the solver solution

    Please Login or Register  to view this content.
    As you have set the the values in the price range as positive or negative this will then cause solver to find a negative value if the price is negative and a posetive one for the D value if the corresponding F value is posetive, all this in order to maximize the sum of revenues (cell G10)

    So you could write the revenue calculation as

    Please Login or Register  to view this content.
    and still get the same result. If on the other hand you write the the calculation results as

    Please Login or Register  to view this content.
    then you allow Solver to use only posetive values in the range D2:D8 and and you total revenues goes up to 1245,12.

    There are two small glitchs in you model, cells to change is set to range D2:D9 but since changing D9 will not affect revenues, range could be set to D2:D8. And the same change could be done in cell G10 i.e. "=SUM(G2:G8)

    Alf
    Last edited by Alf; 10-05-2015 at 12:34 AM.

  14. #14
    Registered User
    Join Date
    10-03-2015
    Location
    Frankfurt, Germany
    MS-Off Ver
    2010
    Posts
    6

    Re: Solver doesn't find maxium revenue

    Hi,

    the problem could be fixed by buying a upgrade for the solver.
    Now it's able to find the maximum.

+ 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. Revenue Calculation based on Variable revenue Percentage
    By suhabthan in forum Excel General
    Replies: 0
    Last Post: 06-19-2014, 12:48 PM
  2. Look Up or Match Range to Criteria, Then Find Minimum or Maxium
    By mycon73 in forum Excel Formulas & Functions
    Replies: 29
    Last Post: 02-06-2014, 01:27 PM
  3. solver doesn't search
    By yangbo07520 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2013, 04:34 PM
  4. Solver doesn't find the right answer
    By yangbo07520 in forum Excel General
    Replies: 1
    Last Post: 10-09-2013, 02:24 PM
  5. solver doesn't find all solutions
    By Alexander_Golinsky in forum Excel General
    Replies: 4
    Last Post: 05-26-2012, 06:13 PM
  6. Replies: 2
    Last Post: 05-23-2012, 07:23 PM
  7. [SOLVED] Solver checked but doesn't appear
    By [email protected] in forum Excel General
    Replies: 1
    Last Post: 02-06-2005, 05:05 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