+ Reply to Thread
Results 1 to 9 of 9

Return max value from list, that ensures separate value does not exceed given amount

  1. #1
    Registered User
    Join Date
    05-07-2015
    Location
    herts, england
    MS-Off Ver
    2016
    Posts
    29

    Return max value from list, that ensures separate value does not exceed given amount

    I've attached an example.

    The values calculated in column H are a multiplication of column F and column G, and a value from the list in column A.

    I need to find a way to return the largest value from column A, that would ensure that the value returned by the formula in column H does not exceed 1 (or any value in cell C3).

    Does this require the solver add-in, or is there a formula that can do it?

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,339

    Re: Return max value from list, that ensures separate value does not exceed given amount

    Deleted. Misinterpreted requirement.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Return max value from list, that ensures separate value does not exceed given amount

    Assuming that you're still using Excel 2007, this array formula will do the job:

    =MAX(IF(F3*G3*$A$3:$A$12<1,$A$3:$A$12,""))

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Return max value from list, that ensures separate value does not exceed given amount

    Maybe try at H3

    =LOOKUP(C$3,F3*G3*$A$3:$A$12)
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-07-2015
    Location
    herts, england
    MS-Off Ver
    2016
    Posts
    29

    Re: Return max value from list, that ensures separate value does not exceed given amount

    Quote Originally Posted by Glenn Kennedy View Post
    Assuming that you're still using Excel 2007, this array formula will do the job:

    =MAX(IF(F3*G3*$A$3:$A$12<1,$A$3:$A$12,""))

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Many thanks! - that works :-)
    I've found array formulas to be quite slow when working with lots of rows - is there a way to do this without an array, using Excel 2016?

  6. #6
    Registered User
    Join Date
    05-07-2015
    Location
    herts, england
    MS-Off Ver
    2016
    Posts
    29

    Re: Return max value from list, that ensures separate value does not exceed given amount

    Quote Originally Posted by Bo_Ry View Post
    Maybe try at H3

    =LOOKUP(C$3,F3*G3*$A$3:$A$12)
    That returns the max value, but doesn't tell you which value from Column A achieved it.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Return max value from list, that ensures separate value does not exceed given amount

    Yes:

    =AGGREGATE(14,6,$A$3:$A$12/(F3*G3*$A$3:$A$12<=$C$3),1)

    Please amend your profile to show your correct Excel version.

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-07-2015
    Location
    herts, england
    MS-Off Ver
    2016
    Posts
    29

    Re: Return max value from list, that ensures separate value does not exceed given amount

    Quote Originally Posted by Glenn Kennedy View Post
    Yes:

    =AGGREGATE(14,6,$A$3:$A$12/(F3*G3*$A$3:$A$12<=$C$3),1)

    Please amend your profile to show your correct Excel version.

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.
    Many thanks!

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Return max value from list, that ensures separate value does not exceed given amount

    Value from Column A

    =LOOKUP(C$3,F3*G3*$A$3:$A$12,$A$3:$A$12)

+ 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. Separate large amount of info to separate tabs
    By ckserra in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-16-2017, 10:59 PM
  2. if statement with result not to exceed a certain amount
    By natiro in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-20-2016, 09:20 PM
  3. Replies: 0
    Last Post: 10-09-2014, 03:00 PM
  4. how to use user form to create a list box with separate return
    By VYES in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2014, 06:10 PM
  5. moving the number when it exceed an amount
    By ccyuri in forum Excel General
    Replies: 4
    Last Post: 11-28-2012, 05:02 PM
  6. Return List by 2 separate variables
    By AdrianGail in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-12-2011, 11:29 AM
  7. Want excel to add together but not exceed total amount
    By pixiesoft in forum Excel General
    Replies: 2
    Last Post: 08-14-2008, 02:30 AM

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