+ Reply to Thread
Results 1 to 3 of 3

Conditionally sum largest N values

  1. #1
    Registered User
    Join Date
    09-18-2006
    Posts
    2

    Conditionally sum largest N values

    I'm working on a spreadsheet and I need help figuring out how to make a function that will conditionally sum the largest N values in a column. This'll be better explained by an example... here's what the columns would look like:

    Please Login or Register  to view this content.
    Now, I need a formula that will sum the values from column B as long as they have an "F" in column A, but only sum the largest 3 of them.

    The closest I've been able to get is =SUMIF(A1:A9,"F",B1:B9), but that only gives me a sum of all the B values that have an "F" in column A. I was trying to use LARGEST along with it, but it uses arrays and SUMIF doesn't accept arrays (I don't think).

    Thanks!

  2. #2
    Forum Contributor kraljb's Avatar
    Join Date
    05-26-2004
    Location
    Illinois
    MS-Off Ver
    2007 (recent change)
    Posts
    256
    To do this you need to use an array formula by hitting Ctrl-Shift-Enter when you are done with the formula

    =SUM(LARGE(IF(A1:A9="F",B1:B9),ROW(INDIRECT("1:3"))))

  3. #3
    Registered User
    Join Date
    09-18-2006
    Posts
    2
    Perfect, thanks!

+ 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