Ask Experts Questions for FREE Help !
Ask
    Dulcie2009's Avatar
    Dulcie2009 Posts: 11, Reputation: 1
    New Member
     
    #1

    Feb 23, 2009, 10:06 PM
    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!
    JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #2

    Feb 23, 2009, 10:16 PM

    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)
    Attached Files
  1. File Type: xls SumproductOrSumif.xls (15.0 KB, 214 views)
  2. Dulcie2009's Avatar
    Dulcie2009 Posts: 11, Reputation: 1
    New Member
     
    #3

    Feb 23, 2009, 10:28 PM
    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

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

I need some sort of explanation. [ 2 Answers ]

I would like to get some input on what is going on here, as the more it happens, the more I am interested in the paranormal and such. The most striking thing that has happened is that while I was in the Memphis Job Corps Center in '99, I gave my camera to a friend to take a picture of me and...

How can I sort data on a Hidden column in Excel? [ 2 Answers ]

I have a spreadsheet that has a pivot table in it. Each record has a time group column and a time nbr column in the pivot table. (i.e. Timegroup = 90 days before and a timenbr of 1 is assigned to this group, Timegroup = 60 days before and a timenbr of 2 is assigned to this group,...

How to sort it?Please help! [ 1 Answers ]

ok heres the low down,im 14 btw just get to know me a bit he he.. been going out with my gf (charlotte) for 8 months now i really really love her might think its puppy love but she kinda my first ...not going to go into detal about what we do. :D we wernt excaclly m8 befour we went out coz we...


View more questions Search