how to create subtotals based on column sort (pivot table)
I have a spreadsheet that contains a list of invoice numbers and then detailed/line items, cost and retail for those invoices. Thus invoice number is repeated for each line item. I want to create a SUBTOTAL of each line item (for both cost and retail) for EACH invoice number. (display in a separate column??). I THINK this is similar to a pivot table in excell (but I've never used those either). I believe this may be a SUMIF function, but not sure how to use those (how to setup function/equation).
sample data below. The results of the calculation that I want to create would be:
inv 100 cost = 9 retail = 24;
inv 101 cost = 10 retail = 25
inv 102 cost = 14 retail = 35
Any help would be appreciated.
Thanks!!
invoice | cost |
retail |
---|---|---|
100 | 4 | 10 |
100 | 3 | 8 |
100 | 2 | 6 |
101 | 4 | 10 |
101 | 6 | 15 |
102 | 4 | 10 |
102 | 2 | 5 |
102 | 8 | 20 |
macbook pro, Mac OS X (10.5.8)