Sum cells based on contents of another


Posted by Dano on December 02, 2001 7:46 AM

I know this is probably very basic, but I still need some help :(

In column A I have a list of store numbers which repeat. In columns B & C I have a number. At the top of my sheet, I would like to sum all cells in B & C which have the same number in column A. Example:

Top:
5013 = "Total" 5020 = "Total" 5026 = "Total"

A B C
5013 3 12
5020 5 6
5026 12 8
5013 8 6
5020 2 9
5026 8 14

Any help would be appreciated :)

Posted by Bariloche on December 02, 2001 8:04 AM

Dano,

Creating a pivot table is probably the solution to your "problem." First, I'd format column A as text (numbers such as yours which are not used to perform calculations should be formatted as text, just to be "safe"). Then click on Data > Pivot Table Report and follow the directions in the wizard. Read the help files on pivot tables for more information.

Pivot tables are a very powerful tool and should be used more often by folks working with "database" style tables.


enjoy




Posted by IML on December 02, 2001 10:53 AM

Sumif route

Another option would be using some if. the format
=SUMIF($A$2:$A$10,5013,B$2:B$10)
will some everything in from B2 to B10 where 5013 is listed in the corresponding A2:a10 cell.
Cell Address also works such as
=SUMIF($A$2:$A$10,a1,B$2:B$10)
where A1 houses your store number.

Good luck

: I know this is probably very basic, but I still need some help :( : In column A I have a list of store numbers which repeat. In columns B & C I have a number. At the top of my sheet, I would like to sum all cells in B & C which have the same number in column A. Example