You are on page 1of 5

What is a pivot table?

It is calculations with criteria


Cross tabulated report (Column criteria + row criteria)

To make a PT what do you need?


A proper fata set:
1) Fields names in 1st row
2) Records in rows (try not to have empty cells)
3) Empty cells surrounding data set (Excel Row & Column Headers is ok too)
4) Data should be in rectangular form
5) Consistent data, not mix text and numbers
6) Source can be in a worksheet or an external database

Key benefits of pivot tables?


 Simplicity
 Speed
 Flexibility
 Accuracy

The trick with PT is to visualize the end result first.


Visualize what you want to have on the row header area, what you want to have in the column header area, and what you want to have in the value area of your pivot table.

Create a table  Alt + N + T


Create a Pivot Table  Alt + N + V

Name the pivot table  Right click  Contextual menu  Pivot Table Options  (Apply anything universally, ex. Column width)  PivotTable Name

You get the pivot table and the PivotTable field prompt
The fields selected are our criteria
To select you want to select the criteria (fields) just drag to the areas
To unselect the criteria, drag it out or uncheck it from the box
Unique list  when you drag a column with duplicate values and PT only shows them once

Formatting a PT  Menu Pivot Table Tools  Design  Layout  Report Layout  Show in Tabular Form
Formatting Numbers in a PT  Right click  Number formatting
Formatting look  Menu Pivot Tools  Design  Pivot Table Styles

Pivot tables doesn’t update automatically


You have to refresh the pivot table if the source data changes
Refreshing a PT  Right click refresh (Alt + F5)
Refreshing a PT  Menu Pivot Table  Analyze  Refresh  Refresh or Refresh All (Control + Alt + F5)
Refreshing PT automatically  Menu Pivot Table  Analyze  Options  Data  On the text box select Refresh data when opening the file

Select a whole PT  Highlight the PT  go to the upper corner  Look for the horizontal black arrow  click

Copy a PT report  Select the pivot table  Control + C  Control V


Copy a PT report  Select empty pivot table report  Control + C  Control V

Moving a PT report  Menu Pivot Table  Analyze  Actions  Move Pivot Table

Changing Functions  Right click on the cell  Summarize value by  Select Function
Pivot Tables have 11 functions: Sum, Count, Average, Max, Min, Product, Count Numbers, StdDev, StdDevp, Var, Varp

Filters in a PT
Filter by default  Sort data A to Z or Z to A, Select data to show (Check or uncheck)

One stop shop for calculations in the value area  Right click in the cell  Value Field Settings

Text data into a Value field  By default it applies count (count (single) means it counts the number of cell not empty, the number of transactions or records)
Formulas vs PivotTables
PivotTables:
1) Fast and easy to create calculations with criteria.
2) Requires "Refresh" when Source Data Changes.
3) You can Pivot a report and add and remove whole categories of criteria and calculations update.
4) Change the function easily.
5) Formatting is limited.
Formulas:
1) Usually more complicated to create calculations with criteria.
2) Automatically updates when Source Data Changes.
3) It is extremely difficult if not impossible to Pivot a report and add and remove whole categories of criteria.
4) Changing a function is more difficult with formulas. 5) Formatting is less limited.

Collapse and Expand criteria in Row Labels  Right click 

Extracting data to new sheet  Double Click

Create a chart  Menu Insert  Pivot Chart (Recommended Pivot Chart)


Create a chart  Menu Analyze  Pivot Chart
Create a Pivot Chart  Alt + F1

Group Dates  in the date cell Right Click  Group  Select (days, months, quarters, years)
Group Times  in the time cell Right Click  Group  Select (seconds, minutes, hours)
Grouping can't be done with Data Mismatch  (Text and numbers)
Group Numbers: Decimal create ambiguous categories
Integers: Lower and Upper Limits are included in Category.
Decimals: Lower Limit is included and Upper Limits is not included in Category).
Integer creates unambiguous categories

Recommended Chart  Menu Insert  Recommended chart


Recommended pivot table  Menu Insert  Recommended PivotTable

Filters filter the whole report


Report Filter: Adds new criteria to report
Add sheets for each filter  Menu  Analyse  PivotTable group  Options  "Show Report Filter Pages"

Slicers Fancy Filters  Pivot Table Tools  Analyze  Filter group  Insert Slicer (Slicer is a fancy filter visualization for the entire report)
Formatting slicers  Menu Slicer Tools  Options 
# Columns
Height
Width
Style (colors)
Align slicers  Control + select both / all  Align (Top, Bottom, Right, Left)
Align Slicer to Column  Alt +
Use Filter and Slicer together to extract data
Slicers with no data  On the slicer Right click  Slicer Settings  Hide items with no data
Timelines  Menu  Pivot Table Tools  Analyze  Filter group  Insert Timeline  Date (You can click and drag)
Connect slicers  Name all pivot tables first  On the slicer, right click  Report connections  select all the PT  Do the same in all slices

Modify PivotTable Style  Pivot Table Tools  Design  In the current design Right click  Modify

Calculated field  Menu Pivot Table Tools  Analyze  Calculation Group  Field, Items & Sets  Calculated Field
Restrictions with calculated item
 A calculated item field cannot be moved to the report filters area
 You cannot add multiple copies of a field to the values area
 A calculated item can make your pivot table slow and its advisable to add the calculations in the source data and the reflect to the pivot table

Use Data Model and Relationships to replace VLOOKUP

VLOOKUP
Excel has a lot of functions – about 450+ of them.

Data Validation  Select column of data  Menu Data  Data Validation  In the text box Settings  Allow  Select List  Source  Select the column  It becomes a drop-
down list.

VLOOKUP looks for a value in the leftmost column of a table, and the ascending order.
When you see it in blue, hit tab to select the function

VLOOKUP has 4 arguments


1-. Is what you want to look up (relative reference)
2-. Where is the table you want to look the match (select the entire table without headers, this has to be a absolute reference, so use F4)
3-. The number of the column we want the value
4-. Exact/ approximate match (0 for exact)
Close parenthesis, Control + Enter to keep the cell to drag
Excel evaluate as 0 when no lookup value, so #N/A not available is the result

IFNA function
Logical function
 True  Value
 False  Customized message

=IFNA(vlookup(lookup_value, array, column_lookup, type of coincidence), “ “)

IFERROR function
Logical function
 True  Value
 False  Customized message

=IFERROR(Vlookup(lookup_value, array, column_lookup, type of coincidence), “ “)

Sum function (only aggregate function with keyboard shortcut)  Alt + =

INDEX Finds the Value-Based on Coordinates


The INDEX function will use the row number and column number to find a cell in the given range and return the value in it.

Below is the syntax of the INDEX function:

=INDEX (array, row_num, [col_num])


=INDEX (array, row_num, [col_num], [area_num])

 array – a range of cells or an array constant.


 row_num – the row number from which the value is to be fetched.
 [col_num] – the column number from which the value is to be fetched. Although this is an optional argument, but if row_num is not provided, it needs to be given.
 [area_num] – (Optional) If array argument is made up of multiple  ranges, this number would be used to select the reference from all the ranges.

INDEX function has 2 syntaxes (just FYI).

The first one is used in most cases.


The second one is used in advanced cases only (such as doing a three-way lookup) which we will cover in one of the examples later in this tutorial.

https://www.youtube.com/watch?v=XikgEUzFc3o&t=10s

MATCH Finds the Position based on a Lookup Value


The Excel MATCH function can find the position of a cell in a range, based on the lookup value.
MATCH function starts looking from top to bottom for the lookup value in the specified range
As soon as it finds the name, it returns the position in that specific range.

Below is the syntax of the MATCH function in Excel.

=MATCH(lookup_value, lookup_array, [match_type])

 lookup_value – The value for which you are looking for a match in the lookup_array.
 lookup_array – The range of cells in which you are searching for the lookup_value.
 [match_type] – (Optional) This specifies how excel should look for a matching value. It can take three values -1, 0, or 1.

Understanding Match Type Argument in MATCH Function


There is one additional thing you need to know about the MATCH function, and it’s about how it goes through the data and finds the cell position.

The third argument of the MATCH function can be 0, 1 or -1.

Below is an explanation of how these arguments work:


 0 – this will look for an exact match of the value. If an exact match is found, the MATCH function will return the cell position. Else, it will return an error.
 1 – this finds the largest value that is less than or equal to the lookup value. For this to work, your data range needs to be sorted in ascending order.
 -1 – this finds the smallest value that is greater than or equal to the lookup value. For this to work, your data range needs to be sorted in descending order.

Below is a video that explains how to use the MATCH function (along with the match type argument)
https://www.youtube.com/watch?v=imWkOka6ACg

To summarize and put it in simple words:


 INDEX needs the cell position (row and column number) and gives the cell value.
 MATCH finds the position by using a lookup value.
Horizontal Match
=Match(lookup_value, range, type of coincidence)

Match to compare two lists


=Match(lookup_value, arrange, type of coincidence)
You get the position in the column

ISNUMBER function
Logical Function
Only one argument
 True condition  True
 False condition  False

Match to compare two list with no full coincidence


Without ISNUMBER function  #N/A (value not available)
With ISNUMBER
=ISNUMBER(Match(lookup_value, array, Type_coincidence)

Match to compare two lists with no full coincidence


=ISNA(Match(lookup_value, array, Type_coincidence)
As per the question you get the opposite result.

INDEX-MATCH
In the Index function, the array can be:
 Two ways
 One way vertical
 One way horizontal
With index arrange, you can do any type of look up

Use INDEX as a substitute for VLOOKUP when the value you want to return is to the left of the lookup column

=INDEX(Vertical range, MATCH(lookup_value, array, Type_coincidence), Type_coincidence)

Horizontal INDEX-MATCH
INDEX array argument is a row

=INDEX(Horizontal range, MATCH(lookup_value, row array, Type_coincidence), Type_coincidence)

Why is INDEX/MATCH Better than VLOOKUP?


 INDEX/MATCH can look to the Left (as well as to the right) of the lookup value
 INDEX/MATCH can work with vertical and horizontal ranges
 VLOOKUP cannot work with descending data
 INDEX/MATCH can be slightly faster
 INDEX/MATCH is Independent of the Actual Column Position

Mini list of useful shortcuts


F2 you can modify the cell without needing to double click on it
Control + Arrows
Going to the right  Tab + Enter
Select cells  shift + arrows
Select all cells  control + shift + arrows
Select all the table  Control + A or Control + E (Background)
Select a whole column  Control + Space
Select a whole row  Shift + Space
Delete a whole row  Control + -
To add a row/column  Control + +
To create a table  Control + T
Formatting cell  Control + 1
Find  Control + F
Bold  Control + B
Filters  Control + shift + L
Select column of data  on the header +  + click
Align slicers to a column  Select the columns + Alt
Calculation in a PT  Double click in the cell
Move, clear o delete a PT  Analyze  Actions
Connect PT  Right click on slicer  Report Connections  Select all the tables
Graphic tools  Menu  Layout  Themes  Colours  Fonts
Find empty cells  End + down arrow

You might also like