0% found this document useful (0 votes)
20 views

Pivot Tble

Data analysis book

Uploaded by

lakshayatri2213
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Pivot Tble

Data analysis book

Uploaded by

lakshayatri2213
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Pivot tables are one of the most powerful and useful features in Excel.

With very
little effort, you can use a pivot table to build good-looking reports for large data
sets.

What is a pivot table?


You can think of a pivot table as a report. However, unlike a static report, a pivot table
provides an interactive view of your data. With very little effort (and no formulas) you
can look at the same data from many different perspectives. You can group data into
categories, break down data into years and months, filter data to include or exclude
categories, and even build charts. The beauty of pivot tables is they allow you to
interactively explore your data in different ways.

Sample data
The sample data contains 452 records with 5 fields of information: Date, Color, Units,
Sales, and Region. This data is perfect for a pivot table.

Data in a proper Excel Table named "Table1". Excel Tables are a great way to build
pivot tables, because they automatically adjust as data is added or removed.
Insert Pivot Table
1. To start off, select any cell in the data and click Pivot Table on the Insert tab of the
ribbon:

Excel will display the Create Pivot Table window. Notice the data range is already
filled in. The default location for a new pivot table is New Worksheet.

2. Override the default location and enter H4 to place the pivot table on the current
worksheet:
3. Click OK, and Excel builds an empty pivot table starting in cell H4.

Note: there are good reasons to place a pivot table on a different worksheet. However, when
learning pivot tables, it's helpful to see both the source data and the pivot table at the same
time.

Excel also displays the PivotTable Fields pane, which is empty at this point. Note all
five fields are listed, but unused:
To build a pivot table, drag fields into one the Columns, Rows, or Values area. The
Filters area is used to apply global filters to a pivot table. The pivot table fields pane
shows how fields were used to create a pivot table.

Add fields
1. Drag the Sales field to the Values area.

Excel calculates a grand total, 26356. This is the sum of all sales values in the entire
data set:

2. Drag the Color field to the Rows area.

Excel breaks out sales by Color. You can see Blue is the top seller, while Red comes
in last:
Notice the Grand Total remains 26356. This makes sense, because we are still
reporting on the full set of data.

Let's take a look at the fields pane at this point. You can see Color is a Row field, and
Sales is a Value field:
Number formatting
Pivot Tables can apply and maintain number formatting automatically to numeric
fields. This is a big time-saver when data changes frequently.

1. Right-click any Sales number and choose Number Format:

2. Apply Currency formatting with zero decimal places, the click OK:
In the resulting pivot table, all sales values have Currency format applied:

Currency format will continue to be applied to Sales values, even when the pivot table
is reconfigured, or new data is added.

Sorting by value
1. Right-click any Sales value and choose Sort > Largest to Smallest.
Excel now lists top-selling colors first. This sort order will be maintained when data
changes, or when the pivot table is reconfigured.

Refresh data
Pivot table data needs to be "refreshed" in order to bring in updates. To reinforce how
this works, we'll make a big change to the source data and watch it flow into the pivot
table.

1. Select cell F5 and change $11.00 to $2000.

2. Right-click anywhere in the pivot table and select "Refresh".


Notice "Red" is now the top selling color, and automatically moves to the top:
3. Change F5 back to $11.00 and refresh the pivot again.

Note: changing F5 to $2000 is not realistic, but it's a good way to force a change you
can easily see in the pivot table. Try changing an existing color to something new, like
"Gold" or "Black". When you refresh, you'll see the new color appear. You can use
undo to go back to original data and pivot.

Second value field


You can add more than one field as a Value field.

1. Drag Units to the Value area to see Sales and Units together:

Percent of total
There are different ways to display values. One option is to show values as a percent
of total. If you want to display the same field in different ways, add the field twice.

1. Remove the Units from the Values area

2. Add the Sales field (again) to the Values area.


3. Right-click the second instance and choose "% of grand total":

The result is a breakdown by color along with a percent of total:

Note: the number format for percentage has also been adjusted to show 1 decimal.
Here is the Fields pane at this point:
Pivot Chart
A pivot chart is the visual representation of a pivot table in Excel. Pivot charts and pivot tables are connected
with each other.

Below you can find a two-dimensional pivot table. Go back to Pivot Tables to learn how to create this pivot
table.

Insert Pivot Chart


To insert a pivot chart, execute the following steps.

1. Click any cell inside the pivot table.

2. On the Analyze tab, in the Tools group, click PivotChart.

The Insert Chart dialog box appears.

3. Click OK.

Below you can find the pivot chart. This pivot chart will amaze and impress your boss.
Note: any changes you make to the pivot chart are immediately reflected in the pivot table and vice versa.

Filter Pivot Chart


To filter this pivot chart, execute the following steps.

1. Use the standard filters (triangles next to Product and Country). For example, use the Country filter to only
show the total amount of each product exported to the United States.

2. Remove the Country filter.

3. Because we added the Category field to the Filters area, we can filter this pivot chart (and pivot table) by
Category. For example, use the Category filter to only show the vegetables exported to each country.
Change Pivot Chart Type
You can change to a different type of pivot chart at any time.

1. Select the chart.

2. On the Design tab, in the Type group, click Change Chart Type.

3. Choose Pie.
4. Click OK.

Note: pie charts always use one data series (in this case, Beans). To get a pivot chart of a country, swap the
data over the axis. First, select the chart. Next, on the Design tab, in the Data group, click Switch
Row/Column.

Inserting Slicer in MS Excel for filtering Pivot Tables


Slicers can be easily inserted in MS Excel by following a simplified procedure in order to
modify and filter Pivot Tables, for effective data representation and analysis. Though,
using Report Filter and inserting a Slicer is exactly the same operation, serving the
same objective, both of them have been discussed in detail here.
To insert a slicer in MS Excel for filtering Pivot Tables and Charts, the following steps
need to be adopted sequentially.

1. Click on any cell inside the pivot table created in spreadsheet.


2. Click on the Analyze tab on Menu Bar and click on Insert Slicer under the Filter section.
3. Insert Slicer dialog box appears. Checkbox against the field name, where the slicer needs to be
inserted and click on OK.
The slicer would be inserted and the requisite Pivot Table would be generated.

Refreshing Pivot Charts


Any changes made onto the data upon which the Pivot Table or Pivot Chart is based,
though is automatically rectified, is not updated immediately and the phenomenon of
Refresh needs to be carried out, to update the Pivot Table or Pivot Chart and the
generation of a revised Pivot Table or Pivot Chart.

The following steps need to be performed sequentially to Update or Refresh Pivot


Charts:

1. Edit the data to make the required and updated spreadsheet


2. Click on any cell inside the Pivot Table or Pivot Chart generated, based on unrevised or older
data.
3. Right Click and Click on Refresh option.

Changing Data Sources of Pivot Tables and Pivot Charts in


MS Excel
Sometimes, a Pivot Table or Pivot Chart is based on data that can be sourced from an
existing spreadsheet or from a new spreadsheet. Thus, data source needs to be
effectively changed in order to generate Pivot Tables and Pivot Charts that are desired
and required for effective data representation and analysis. This is also used to make
Pivot Charts and Pivot Tables more informative as well as helps to relate spreadsheets
that contain associated information and provides an effective means of keeping related
information together.

The following steps need to be performed in order to change data sources of Pivot
Tables and Pivot Charts in MS Excel:

1. Click on any cell inside the Pivot Table or Pivot Chart generated, based on unrevised or older
data.
2. Click on Analyze Tab on Menu Bar, and further click on Change Data Source option under Data
section.
3. Choose the appropriate Data Source and click on OK.
4. Click on Refresh so that the appropriate Pivot Table and Pivot Chart are generated.
Note: It is advisable for any proficient Excel user to change data of a spreadsheet
before you insert a pivot table. This way your data source is updated automatically and
can help in saving time. However, Refresh needs to be clicked in order to generate the
updated Pivot Table and Pivot Chart.

Advantages of Pivot Charts


1. Effective way of representing data in a pictorial manner.
2. Makes the process of visualization of data easier.
3. Facilitates Data Analysis.
4. Used to draw various conclusions and form the basis of statistical development.
5. Efficient means of handling with large unsized raw data by relating them through filtering and
slicing.

You might also like