+ Reply to Thread
Results 1 to 8 of 8

excel 2007 solver function

  1. #1
    Registered User
    Join Date
    03-20-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    excel 2007 solver function

    Hi all,

    I'm trying to get my solver to work on a problem but I'm having a hard time getting the formulas to work for solver.

    The goal is to maximize the SUM of the area under Y curve but the time range is dependent on a function.

    My table is setup like this: X, Y, A

    X is time
    Y is distance
    A is area under curve for Y distance at X time

    This is where I start to get stuck...

    Here is ideally how it should work:

    Start time = X1 through X30, Excel trys each value in column X
    End time = based on a function and Start time (will match some value in X1 through X30 once rounded)
    Maximize Sum A (sum up the values in A for the solved range)

    Here is my little example:

    Start time is X15 (excel will eventually try X1 through X30 once solver runs and maximizes A)
    End time works out to be X10 after applying the function (it will change when excel trys different start times)
    Sum(A10:A15) (this sum range will also change when excel trys different start times)


    I can't figure out how to get the solver to do something like this. I've attached my spreadsheet in case my rambling is hard to understand. Any help is much appreciated!
    Attached Files Attached Files

  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: excel 2007 solver function

    I think it's easier to solve this without Solver.

    Please Login or Register  to view this content.
    The formula in E6 and down is

    =B6/(1-$C$3)

    In F6 and down,

    =SUM(D6:INDEX(D$6:D$52, MATCH(E6, B$6:B$52)))
    Last edited by shg; 03-21-2011 at 07:04 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-20-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    re: excel 2007 solver function

    shg,

    Thanks for the input!

    After looking through the code, I might have misexplained myself. If I brute force what I'm trying to get excel to automate, in one way or another, I get a maximized sum at time = 6600 (if I recall correctly).

    Basically to brute force the calculation this is what I do (using your table for my numbers):

    time drop percentage = .614

    Pick a time (anything in column B6 through B52), say B34 = 6600
    delta time = B34 - (B34 * .614) = 2620
    new time after change = 6600 - 2620 = 4180 (round this number to a whole number to match a time in the table) so you get 4200 which matches up to B22
    Now I finally SUM(D34:D22) = the sum of the area under the curve for the range.

    I get mixed up because the range varies based on a percentage and I can't figure out how to get excel to recongnize that and then sum up the adjacent columns.


    Much appreciated!

  4. #4
    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: excel 2007 solver function

    See attached.
    Attached Files Attached Files
    Last edited by shg; 03-22-2011 at 02:28 PM.

  5. #5
    Registered User
    Join Date
    03-20-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    re: excel 2007 solver function

    Shg,

    You're the man! Thanks so much!

  6. #6
    Registered User
    Join Date
    03-20-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    re: excel 2007 solver function

    I had one more quick question. What excel function could I use to to say what the time was at the maximum value of the area under the curve?

    Say time is Ax and the maximum valve of the area is C, how could I get an excel cell to say Ax based on MAX(Cx:Cx)?


    Much appreciated!

  7. #7
    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: excel 2007 solver function

    =index(b6:b52, match(max(f6:f52), f6:f52, 0))

  8. #8
    Registered User
    Join Date
    03-20-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    re: excel 2007 solver function

    Again, shg, you're the excel man

+ 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