+ Reply to Thread
Results 1 to 14 of 14

Finding next 3 highest values after certain criteria

  1. #1
    Registered User
    Join Date
    01-31-2013
    Location
    England
    MS-Off Ver
    Pro Plus 2016
    Posts
    19

    Finding next 3 highest values after certain criteria

    Hi everybody

    I am having some difficulty in coming up with a formula and could really do with some help.

    I have 16 columns, split into 8 'category A' and 8 'category B'. These will be filled with numerical values when populated.

    The formula I'm trying to work out is to get the sum of the next 3 highest values (of either category A or B), after you have taken out the top 2 category A and top 2 category B values. It's this different category business that I can't get my head round.

    As an example the table looks something like this, values simplified and colours added for clarity example table.jpg

    Any help or suggestions are much appreciated.
    Many thanks.
    Last edited by jamblo; 02-05-2013 at 03:42 PM. Reason: solved

  2. #2
    Registered User
    Join Date
    01-31-2013
    Location
    England
    MS-Off Ver
    Pro Plus 2016
    Posts
    19

    Re: Finding next 3 highest values after certain criteria

    Sorry this is the actual excel file rather than just a picture example.xlsx

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Finding next 3 highest values after certain criteria

    Try

    Please Login or Register  to view this content.
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Registered User
    Join Date
    01-31-2013
    Location
    England
    MS-Off Ver
    Pro Plus 2016
    Posts
    19

    Re: Finding next 3 highest values after certain criteria

    Thanks Ace_XL, I had thought of that and tried it, but it only works only if there are definitely 2 category A and 2 category B values.

    For example, please see attached spreadsheet,
    example2.xlsx

    If there are no category B values, the formula gives an outcome of 500, when it should in fact be 300.

    Thanks for your help

  5. #5
    Registered User
    Join Date
    01-31-2013
    Location
    England
    MS-Off Ver
    Pro Plus 2016
    Posts
    19

    Re: Finding next 3 highest values after certain criteria

    I couldn't find anything in the rules about not being able to bump this back up so hope that's ok with the administrators(?). Apologies if it's not.

    The only thing I can think of is somehow using the IF function combined with the above fomula, but it's beyond me at the moment to work out how.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Finding next 3 highest values after certain criteria

    we normally prefer a little longer duration between posts, but a bump is fine

    try this....
    =SUM(LARGE(C15:G16,{3,4,5})) (assuming your range is C15:G16 - adjust as needed)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Registered User
    Join Date
    01-31-2013
    Location
    England
    MS-Off Ver
    Pro Plus 2016
    Posts
    19

    Re: Finding next 3 highest values after certain criteria

    Thankyou FDibbins. Good to know.

    That formula works for that specific sum (row 7 on the attached sheet), but I have added another example in row 9 where it doesn't.

    example3.xlsx

    Perhaps I am not explaining what result is required that well? In which case I'll have another go:

    I need to find the sum of the next 3 highest values(in the attached spreadsheet this is in column U, called 'Best 3 of the rest), from the given total range, after the 2 highest values of a range within that range (call it category A range) and another 2 highest values from a different range within the total range (call that category B range) are taken out. It's hard to explain in words but should make sense when looking at the data I hope.

    Many thanks

  8. #8
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Finding next 3 highest values after certain criteria

    you could try this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This is based on range "A" as being the one to have values, you would have to adjust for it being range"B"

    Hope this helps
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  9. #9
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Finding next 3 highest values after certain criteria

    Try this array formula..

    Please Login or Register  to view this content.
    Confirm with Ctrl+Shift+Enter and not just Enter

  10. #10
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Finding next 3 highest values after certain criteria

    or...hopefully this non-array formula, I haven't tested EVERY possible cobination yet, but it does so far seem to do the trick :
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Hope this helps

  11. #11
    Registered User
    Join Date
    01-31-2013
    Location
    England
    MS-Off Ver
    Pro Plus 2016
    Posts
    19

    Re: Finding next 3 highest values after certain criteria

    Thankyou @Ace_XL and @dredwolf

    I tried both your array and normal formulae and from multiple different scenario testing (read 'all that I could think of') I think they both work perfectly.

    In the end I went with the non-array formula because I understood it more and could manipulate it to what I needed.

    If you were interested...the actual problem is for a running club championship series with different races, with some being on road, and some off-road - these are the different 'categories'... I think it would have been easier if I'd explained that straight away.

    The actual data isn't in nice neat ranges so I had to sum the COUNTIF's together, to give the messy formula in column X:

    Example4.xlsx

    but it works a treat, and I'm extremely grateful for all of the time and work you put in.

    Thanks again

    I'll mark this as solved.

  12. #12
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Finding next 3 highest values after certain criteria

    You are welcome

  13. #13
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Finding next 3 highest values after certain criteria

    Sorry, I'm late to the party but this non-array version should work for your original example

    =SUM(LARGE(IF({1;0},LARGE(B3:I3,{3,4,5}),LARGE(J3:Q3,{3,4,5})),{1,2,3}))

    You can expand the ranges out into individual cells for your "real" formula, i.e. for X2 try

    =SUM(LARGE(IF({1;0},LARGE((C2,D2,G2,J2,L2,M2,P2,Q2),{3,4,5}),LARGE((E2,F2,H2,I2,K2,N2,O2,R2),{3,4,5})),{1,2,3}))

    when I put some random values in C2:R2 I get different results for my formula and yours - I think mine is working correctly.........
    Audere est facere

  14. #14
    Registered User
    Join Date
    01-31-2013
    Location
    England
    MS-Off Ver
    Pro Plus 2016
    Posts
    19

    Re: Finding next 3 highest values after certain criteria

    Quote Originally Posted by daddylonglegs View Post
    when I put some random values in C2:R2 I get different results for my formula and yours - I think mine is working correctly.........
    so do I!...funny, I'm sure when I was checking yesterday it was working though. I must have made an error somewhere when trying to transcribe the example formula onto the running spreadsheet.

    Your formula is a lot tidier than my efforts anyway... and it works 100% of the time which helps

    Thanks daddylonglegs

+ 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