Docsity

Building a PivotTable Report: A Comprehensive Guide, Slides of English

Toggle sidebar
bg1
Excel Advanced
Contents
Formulas ....................................................................................................................................................... 3
VLOOKUP................................................................................................................................................... 3
COUNTIFS .................................................................................................................................................. 4
COUNT ................................................................................................................................................... 4
IF ............................................................................................................................................................ 5
COUNTIF ................................................................................................................................................ 5
COUNTIFS .............................................................................................................................................. 6
Filters............................................................................................................................................................. 7
Ribbon Tour............................................................................................................................................... 7
Quick Filtering ........................................................................................................................................... 7
Filtering by Multiple Criteria ..................................................................................................................... 9
Saving the Filtered Data .......................................................................................................................... 11
Performing Calculations on Filtered Data ............................................................................................... 12
PivotTables .................................................................................................................................................. 13
Defined .................................................................................................................................................... 13
Basic PivotTable Data .............................................................................................................................. 14
Inserting a Pivot Table............................................................................................................................. 14
PivotTable Geography ............................................................................................................................. 15
Building a PivotTable Report – Part One................................................................................................. 16
Adding row labels, adding column data, changing formulas in columns, changing headers & number
formats ................................................................................................................................................ 16
Building a PivotTable Report – Part Two ................................................................................................ 24
Adding multiple row labels, collapsing and expanding, drill down to data, sorting, & refreshing ..... 24
Building a PivotTable Report – Part Three .............................................................................................. 26
Grouping by dates, grouping by ranges, show items with no detail, show values in empty cells,
grouping across columns .................................................................................................................... 26
Building a PivotTable Report – Part Four ................................................................................................ 33
User defined groups, adding/removing subtotals .............................................................................. 33
Building a PivotTable Report – Part Five ................................................................................................. 35
Using formulas on pivoted data .......................................................................................................... 35
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c

Partial preview of the text

Download Building a PivotTable Report: A Comprehensive Guide and more Slides English in PDF only on Docsity!

Excel Advanced

  • Formulas Contents
    • VLOOKUP...................................................................................................................................................
    • COUNTIFS
      • COUNT...................................................................................................................................................
      • IF
      • COUNTIF
      • COUNTIFS
  • Filters.............................................................................................................................................................
    • Ribbon Tour...............................................................................................................................................
    • Quick Filtering
    • Filtering by Multiple Criteria
    • Saving the Filtered Data
    • Performing Calculations on Filtered Data
  • PivotTables
    • Defined....................................................................................................................................................
    • Basic PivotTable Data
    • Inserting a Pivot Table.............................................................................................................................
    • PivotTable Geography
    • Building a PivotTable Report – Part One.................................................................................................
      • formats Adding row labels, adding column data, changing formulas in columns, changing headers & number
    • Building a PivotTable Report – Part Two
      • Adding multiple row labels, collapsing and expanding, drill down to data, sorting, & refreshing
    • Building a PivotTable Report – Part Three
      • grouping across columns Grouping by dates, grouping by ranges, show items with no detail, show values in empty cells,
    • Building a PivotTable Report – Part Four
      • User defined groups, adding/removing subtotals
    • Building a PivotTable Report – Part Five
      • Using formulas on pivoted data
  • Building a PivotTable Report – Part Six
    • Displaying multiple row labels in columns, or tabular form.
  • Other Cool Things to do with a Pivot Table – Part Seven
    • Report Filters.......................................................................................................................................
    • Report Slicers
    • Expanding Filter Results to Individual Tabs
  • Formatting as a Table - Part Eight

COUNTIFS

Recall quickly the COUNT and IF commands.

COUNT

The COUNT function counts the number of cells that contain numbers and counts numbers within the

list of arguments.

The syntax is COUNT( value1, value2, …)

Continuing on with our SUM formula from above, let’s not only add up the values of the range A1:A4,

but let’s count how many numbers are included within the range, i.e. how many cells within the range

has a value in it.

The formula is =COUNT(A1:A4). The English translation is count how many cells within the range has a value in it and display the result.

Notice that the range is exactly the same as our SUM, A1:A4, which includes four rows. The value returned in cell A7 is three, because only three of the four rows have values in them.

If you are trying to count text, use the COUNTA formula which counts the non-blank cells.

IF The formula makes a statement/question, if the answer is true then one response is obtained. If the answer if false, then another answer is obtained.

The syntax is =IF(logical_test,value_if_true,value_if_false)

Continuing on with our SUM formula from above, let’s add some verbage to emphasize whether the result is greater or less than twenty.

The formula is =if(A5<20,”Amount is less than twenty”,”Amount is more than twenty”). The English translation is if the value found in A5 is less than twenty THEN display the comment ‘Amount is less than twenty’ ELSE display the comment ‘Amount is more than twenty’.

COUNTIF

The COUNT function counts the number of cells in a range, that meets single criteria.

Filters

Ribbon Tour

Quick Filtering

The secret to filtering is not to have a space between your titles and your data. In fact, Excel is so smart, that you do not even have your data selected, but may if you prefer.

Select your data and left click on the filter icon in the Sort & Filter Group.

Notice that a chevron appears to the left of each header.

By selecting the chevron to the left of Vendor Name, a dialog box appears displaying all unique text filters found in the range as well as other common sort icons.

If you only want a particular filter, deselect the (Select All) box and check the filter you desire.

In the below screen shot, Kendell Kilborn is selected. Notice the hidden rows to the left. Those represent data lines for mileage paid to individuals other than Kendell. No data is lost, it is just currently hidden.

Also note that the icon to the left of the vendor name now displays the filter icon. This so at a glance the user may see that the data range has been filtered.

The results appear below.

1 2

4

5

Saving the Filtered Data

Now that the data has been filtered it would be great to save it so you can manipulate it further. To do so is a rather straight forward process. Basically you will go to where you want to save it, Sheet2 in our example, and go through the filtering process that we did above with just a couple of twists.

Steps For Advanced Filtering

On the destination worksheet (Sheet2 for example) place the cursor in a blank cell.

Select the Advanced icon with your left mouse button. Under Action, select copy to another location

  • In the list range, select the range finder icon.

The appears. Navigate to the appropriate worksheet and select the data range not forgeting the headers, and click on the little icon at the bottom right.

  • Do the same for the criteria range.
  • For the copy to range, select the first cell and select OK

1

2

3

4

An example of the formula is: =SUBTOTAL(9,E12:F19) The English translation is using the ninth subtotal function, which is SUM, add up all of the data within the range that is selected by the filter. For comparison, included is the SUM function for the same range which brought back the total for all of the data cells, hidden or displayed.

PivotTables

Defined

The foundation of what is a PivotTable report is explained as follows:

As long as you can connect to the data, whether it be locally in the same workbook or remotely in other locations, you can built PivotTable reports that rearrange the raw data and change it into meaningful information

A pivot table is an interactive way to quickly summarize large amounts of data; to analyze numerical data in detail and to answer unanticipated questions. They are especially designed for:

  • Querying large amounts of data in many user-friendly ways
  • Subtotaling and aggregating numeric data, summarizing data by categories and subcategories, and creating custom calculations and formulas
  • Expanding and collapsing levels of data to focus your results, and drilling down to details from the summary data.
  • Moving rows to columns or columns to rows (or “pivoting”0 to see different summaries of the source data.
  • Filtering, sorting, grouping, and conditionally formatting the most useful and interesting subset of data to enable you to focus on the information that you want.

Thou Shalts in PivotTable Land

1 Headers should be in columns, not rows

2 No blank rows between the headers and the data

Best to have the pivot table on a separate worksheet so it does not accidently clobber the data

4 Best to have simple data, rows and columns of data.

5 Best to format your area as a table, especially when you will be adding data to it. The table is automatically expanded when data is added to the next row. Now when you launch create a pivot table the range will be the table name, and not the cell addresses

Basic PivotTable Data

Pivot Tables work best when you have simple data in rows and columns.

  • Headers are across the top in the first row
  • Data consists of a single row across numerous columns
  • There is not a blank row between the headers and the rows

Inserting a Pivot Table

  • Select any active cell within your data table
  • Navigate to the Insert tab and select PivotTable

PivotTable Geography

The pivot table will be located here. The size will adjust as it needs to automatically.

  • NOTE: If you move your mouse out of this area, the PivotTable Field List will disappear. To get it back, merely left click your mouse within this area again and it will appear. The fields listed here are your column headers on your original data source.
  • These fields may be utilized in designing your PivotTable Report.
  • You may use a field more than once. Report Filters:
  • Similar to a mentally page break. Allows the user to classify the data

Column Labels:

  • Often created automatically by dragging data fields to the value zone. The user may also drag data fields to this zone for grouping, etc. Row Labels:
  • Most common label Values:
  • Wide range of calculations may be performed on the values dragged to this zone.

Building a PivotTable Report – Part One

Adding row labels, adding column data, changing formulas in columns, changing headers & number formats In order to best illustrate how to design pivot tables, we will begin with the goal report, depicted below, and then step through each design component.

This table will represent by department, the number of employees per department and their average salary. We will also change a column header and the number font for the salary column.

1 2 3 4 5 6

Figure 1: Building a PivotTable- Part One

Adding a COUNT and SUM Columns

  • Drag down last name and salary into the Value zone
  • Last Name o Every employee has a last name. So if we use last name in a value field the result displayed in the field will merely be the number of last names that we have. o Note that the formula used is count because it is a text field.
  • Salary o Excel automatically used the SUM formula. o The SUM formula needs to be changed to the AVERAGE formula

To change the formula, we will launch the value fields setting dialog box and choose a different

formula.

2

1

2

1

1

2

Changing a Formula

Left click on the Sum of Salary field

The value dialog box will appear. Using a left click on your mouse, select the Value Field Settings

The value field settings dialog box appears. On the summarized by tab, select the average calculation from the drop down box

1

2

3

1

2

3