+ Reply to Thread
Results 1 to 5 of 5

Exclude rows from SUM based on the row returned from another column

  1. #1
    Registered User
    Join Date
    04-21-2010
    Location
    PA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Exclude rows from SUM based on the row returned from another column

    Hello,

    I’m new with Excel and am struggling to figure out how to do the following:

    I would like to SUM the values in Column B, but exclude any rows that correspond with where the N number of largest values in column D are found.
    For example I want to search column D, find the rows where the two largest values are, and exclude those rows from the SUM in column B.

    Any help is greatly appreciated. Thank you.
    Last edited by dgib2008; 04-25-2010 at 06:50 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    122

    Re: Exclude rows from SUM based on the row returned from another column

    Let's see if I got this right. You records in B2:D10.

    =SUMPRODUCT(--(D2:D10<LARGE(D2:D10,2)),B2:B10)

    Regards

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Exclude rows from SUM based on the row returned from another column

    sailepaty, the same could be achieved with a standard SUMIF as I see it, no ?

    =SUMIF(D2:D10,"<"&LARGE(D2:D10,2),B2:B10)

    Of course it's not clear as to what should happen if there were multiple instances of the 2nd largest value within the data set....eg:

    Please Login or Register  to view this content.
    what would be the expected result - 21 (all instances associated with 6 are discounted) or 28/30 (either or is discounted - first/last) ?

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2007
    Posts
    122

    Re: Exclude rows from SUM based on the row returned from another column

    Quote Originally Posted by DonkeyOte View Post
    sailepaty, the same could be achieved with a standard SUMIF as I see it, no ?
    You're totally right.

    Regards

  5. #5
    Registered User
    Join Date
    04-21-2010
    Location
    PA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Exclude rows from SUM based on the row returned from another column

    That works great. Thank you both.

+ 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