Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Group by Sum in Excel

Let's assume that I have the following table in Excel

A     B
Item  quantity_sold
A     3
A     4
A     1
B     5
B     2
D     12
C     3
C     7
C     8

and I need to sum up quantity_sold grouped by Item and print the results on the adjacent column only once per group, similar to the following

A     B                 C   
Item  quantity_sold    SUM_by_item_type
A     3                 8
A     4
A     1
B     5                 7
B     2
D     12                12
C     3                 18
C     7
C     8

Is there any way I can achieve this without using Pivot Tables?

enter image description here

like image 642
Ahmedov Avatar asked Sep 18 '13 10:09

Ahmedov


2 Answers

I'd create a smaller table alongside (or on a different sheet) and use

=SUMIF(A:A,"A",B:B)

where...

=SUMIF(different-item-range,"what you're looking for",things-to-add-together)

=SUMIF is all explained here: http://office.microsoft.com/en-gb/excel-help/sumif-function-HP010062465.aspx

like image 154
Scott Brown Avatar answered Oct 22 '22 12:10

Scott Brown


Subtotal feature:

  1. Click the Data tab in Excel's ribbon toolbar
  2. Click the Sort button and sort by your category column
  3. Click the Subtotal button and fill in the dialog as appropriate, then click OK

Video example: https://www.youtube.com/watch?v=OBj30n_x5aQ

like image 30
razon Avatar answered Oct 22 '22 13:10

razon