When you have a lot of data, it can sometimes be difficult to analyze all of the information in your worksheet. PivotTables can help make your worksheets more manageable by summarizing data and allowing you to manipulate it in different ways.
Watch the video below to learn more about PivotTables.
Using PivotTables to answer questions
Consider the example below. Let's say we wanted to answer the question What is the amount sold by each salesperson? Answering it could be time consuming and difficult; each salesperson appears on multiple rows, and we would need to total all of their different orders individually. We could use the Subtotal command to help find the total for each salesperson, but we would still have a lot of data to work with.
Fortunately, a PivotTable can instantly calculate and summarize the data in a way that will make it much easier to read. When we're done, the PivotTable will look something like this:
Once you've created a PivotTable, you can use it to answer different questions by rearranging—or pivoting—the data. For example, let's say we wanted to answer What is the total amount sold in each month? We could modify our PivotTable to look like this:
To create a PivotTable:
- Select the table or cells (including column headers) you want to include in your PivotTable.
- From the Insert tab, click the PivotTable command.
- The Create PivotTable dialog box will appear. Choose your settings, then click OK. In our example, we'll use Table1 as our source data and place the PivotTable in a new worksheet.
- A blank PivotTable and Field List will appear in a new worksheet.
- Once you create a PivotTable, you'll need to decide which fields to add. Each field is simply a column header from the source data. In the PivotTable Fields list, check the box for each field you want to add. In our example, we want to know the total amount sold by each salesperson, so we'll check the Salesperson and Order Amount fields.
- The selected fields will be added to one of the four areas below. In our example, the Salesperson field has been added to the Rows area, while Order Amount has been added to Values. You can also click and drag fields directly into the desired area.
- The PivotTable will calculate and summarize the selected fields. In our example, the PivotTable shows the amount sold by each salesperson.
Just like with normal spreadsheets, you can sort the data in a PivotTable using the Sort & Filter command on the Home tab. You can also apply any type of number formatting you want. For example, you may want to change the number format to Currency. However, be aware that some types of formatting may disappear when you modify the PivotTable.
Pivoting data
One of the best things about PivotTables is that they can quickly pivot—or reorganize—your data, allowing you to examine your worksheet in several ways. Pivoting data can help you answer different questions and even experiment with your data to discover new trends and patterns.
To add columns:
So far, our PivotTable has only shown one column of data at a time. To show multiple columns, you'll need to add a field to the Columns area.
- Drag a field from the Field List into the Columns area. In our example, we'll use the Month field.
- The PivotTable will include multiple columns. In our example, there is now a column for each person's monthly sales, in addition to the grand total.
To change a row or column:
Changing a row or column can give you a completely different perspective on your data. All you have to do is remove the field in question, then replace it with another.
- Drag the field you want to remove out of its current area. You can also uncheck the appropriate box in the Field List. In this example, we've removed the Month and Salesperson fields.
- Drag a new field into the desired area. In our example, we'll place the Region field under Rows.
- The PivotTable will adjust—or pivot—to show the new data. In our example, it now shows the amount sold by each region.
Challenge!
- Open our practice workbook.
- Create a PivotTable in a separate sheet.
- We want to answer the question What is the total amount sold in each region? To do this, select Region and Order Amount. When you're finished, your workbook should look like this:
- In the Rows area, remove Region and replace it with Salesperson.
- Add Month to the Columns area.
- Change the number format of cells B5:E13 to Currency. Note: You might have to make columns C and D wider to see the values.
- When you're finished, your workbook should look like this:
FAQs
Why did my PivotTable disappear?
If the PivotTable Fields pane disappears on the right, simply click anywhere inside your PivotTable on the worksheet to bring it back. If you accidentally closed it, go to the Analyze tab and click Field List.
Why isn't my PivotTable showing new data I added?
PivotTables do not automatically update when you change the source data. You must click inside the PivotTable, go to the Analyze tab, and click Refresh to pull in the new data.
What is the "Values" area for?
The Values area is where the actual math happens. If you drag a number field (like Sales) here, Excel will usually SUM it. If you drag text here, Excel will COUNT it.
Can I change from SUM to AVERAGE in a PivotTable?
Yes. In the Values box in the bottom right, click the field (e.g., "Sum of Sales"), select Value Field Settings, and change it from SUM to AVERAGE or COUNT.
Why does it say "Row Labels" instead of my column name?
This is the default Compact Layout. To show the actual column headers, go to the Design tab, click Report Layout, and choose Show in Tabular Form.
No comments:
Post a Comment