Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Spreadsheets (https://www.askmehelpdesk.com/forumdisplay.php?f=395)
-   -   Sort a Column & sum the range with same value during the sort (https://www.askmehelpdesk.com/showthread.php?t=321276)

  • Feb 23, 2009, 10:06 PM
    Dulcie2009
    Sort a Column & sum the range with same value during the sort
    Hi, I'm trying to sort a data table by Grades & then sum the totals of the cell with same Grade. The table consists of this headers: Date, DD#, Grade, Bags so what I'm trying to do is to come up with a formula that can sort by Grade & then add the total Bags against that particular Grade and display on the summary sheet.

    Any help is greatly appreciated!
  • Feb 23, 2009, 10:16 PM
    JBeaucaire
    1 Attachment(s)

    That's a SUMPRODUCT formula, or a SUMIF, either will work.

    =SUMIF($C$2:$C$10,F2,$D$2:$D$10)
    vs.
    =SUMPRODUCT(--($C$2:$C$10=F2),$D$2:$D$10)

    Given a choice, I would opt for the SUMIF since it is not volatile, like SUMPRODUCT.

    But SUMPRODUCT can be fed additional filter criteria. For instance you could get all the As for a particular date by adding another section.

    =SUMPRODUCT(--($C$2:$C$10=F2),--(B2:B10="DD1"),$D$2:$D$10)

    (attachment with sample)
  • Feb 23, 2009, 10:28 PM
    Dulcie2009
    Quote:

    Originally Posted by JBeaucaire View Post
    That's a SUMPRODUCT formula, or a SUMIF, either will work.

    =SUMIF($C$2:$C$10,F2,$D$2:$D$10)
    vs.
    =SUMPRODUCT(--($C$2:$C$10=F2),$D$2:$D$10)

    Given a choice, I would opt for the SUMIF since it is not volatile, like SUMPRODUCT.

    But SUMPRODUCT can be fed additional filter criteria. For instance you could get all the As for a particular date by adding another section.

    =SUMPRODUCT(--($C$2:$C$10=F2),--(B2:B10="DD1"),$D$2:$D$10)

    (attachment with sample)

    Thank you so much JBeaucaire! That is exactly what I needed...

    Thanks

  • All times are GMT -7. The time now is 03:58 AM.