Four Ways To Summarize Data
April 13, 2006
You have a dataset with customer, date, HW Sales, SW Sales, Total. There are thousands of rows. You would like to get totals by customer. Today's episode shows four ways for getting the totals.
- Copy the Customer heading to a blank cell G1.
- From the menu, Data - Filter - Advanced Filter.
In the Advanced Filter dialog, choose Copy to New Location, Unique Values. Specify G1 as the output range
This will give you a unique list of customers in column G.
The formula in H2 is
Copy the formula down to the other rows in column H. Results:
- Choose a single cell in column A.
- Click the AZ sort button in the standard toolbar.
From the menu, select Data - Subtotals. Fill out the dialog like this:
Press the "2" group and outline button to show a summary.
Method 3: Consolidate
- Select a blank cell to the right of your data.
- From the menu, Data - Consolidate.
- Fill out the Consolidate dialog as follows:
The result: For each unique customer in the left column of your data, you get one row. Excel sums all numeric data, which in this case includes the date field. You will have to delete the date field.
Method 4: Pivot Table
Select a single cell in your data. From the menu, Data - Pivot Table and PivotChart Report.
- Click Finish.
Click on Customer. Click Add to Row Area.
Click on Total. Click on Add to Data Area.
The pivot table is complete.
Excel is a great product because there are many ways to accomplish any task. As shown here, there are four ways to produce totals by customer!