is348 an introduction to pivottables using excel 2007 · is348 introduction to excel’s...

32
Using Excel 2007 Information Technology Skills Series IS348 An Introduction to PivotTables January 2012

Upload: others

Post on 28-Jul-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Using Excel 2007

Information Technology Skills Series

IS348 An Introduction to PivotTables

January 2012

Page 2: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

These Session Notes are available in alternative formats on request. For furtherinformation please contact Chris Horton in Computer Centre Room 108

(01784 41 4105, [email protected])

© Royal Holloway and Bedford New College 2011. All Rights Reserved

Page 3: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

11th January 20112

IS348 Introduction to Excel 2007’s PivotTables

Contents

The file you will require for this session is: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Outline of the session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

What is a PivotTable? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Starting Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Opening the Session’s Workbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Saving the Workbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Use of Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Viewing the List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Creating a PivotTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Changing the PivotTable View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Selecting the Headings (Fields) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Improving the PivotTable’s Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Renaming a Worksheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Changing a Field’s Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Adding Further Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Modifying the PivotTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Changing the PivotTable’s Column Headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Changing PivotTable Updates During Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Creating a New PivotTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Adding to the PivotTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Improving the PivotTable’s Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Modifying the PivotTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Hiding and Displaying Subtotals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Renaming the Worksheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Updating the PivotTable Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Hiding and Displaying Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Obtaining More Detail from the PivotTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Using the Headings’ Drop-Down Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Formatting a PivotTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Using the Column Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Summarising More Complicated Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Creating PivotCharts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Consolidation Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

Accessing the IT Training Exercise Files and (Y:) drive from your own PC/Laptop . . . . . . . . 27

Page 4: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand
Page 5: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Royal Holloway IT Department IS348 Introduction to Excel’s PivotTables

Page 1

IS348 Introduction to Excel 2007’s PivotTables

The file you will require for this session is:

File Name Location

New IS348 PivotTables.xlsx R:\IT Training\Advanced\New IS348 PivotTables.xlsx

Outline of the session1. In this session we will examine the basics of producing and using Excel’s PivotTables

feature. You will learn how to create a PivotTable, and how to modify it so that it bettersuits your needs. You will also learn how to change its appearance by, for example,applying a sort order, and removing/adding subtotals. You will also learn how toproduce a chart from the PivotTable using the PivotChart facility.

What is a PivotTable?2. In its simplest form, a PivotTable is a summary of an Excel list. However, in reality it is

a collection of analytical tools that lets you quickly create summary information with theability to sort, filter, group and rearrange data to suit your particular need.Although you can create a PivotTable that does not summarise numerical information,most PivotTables are focussed on numbers. However, it is perfectly feasible, forexample, to create PivotTables that merely provide counts of entries.

What you can do with a PivotTable:< Quickly summarise data from a worksheet< Calculate totals, averages, counts, etc. based on any numeric field(s) in your

table< Generate charts from your PivotTables

The advantages of using a PivotTable:< PivotTables are interactive, that is, you can easily rearrange them by moving,

adding, or deleting fields< PivotTables are dynamic, which means that results are automatically recalculated

whenever fields are added or removed, or categories hidden/displayed< PivotTables are easy to update if the original worksheet data is changed

Starting Excel3. We will begin by opening Excel. To do this from an Open-Access PC:

a. Click on the Start button to open the Start Menu.

b. Click on . Excel 2007 will now open.

Opening the Session’s Workbook4. For today’s session we are going to use a workbook called New IS348

PivotTables.xlsx. To open this file:

a. Click on the Office button at the top left-hand corner of the window.

b. Click on Open to display the Open dialogue box.

Page 6: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department

Page 2

c. If necessary scroll down in the left-hand panel to display the list of availabledrives.

d. Click on the (R:) drive in the list to select the drive and display its contents in theright-hand panel.

e. In the right-hand panel locate the IT Training folder, and then double-click on itto display the files and folders it contains.

f. The Workbook you need is in the Advanced subfolder, so locate this folder inthe right-hand panel and then double-click on it to display its contents.

g. In the right-hand panel locate New IS348 PivotTables.xlsx and then select itby clicking on it.

h. Click on to open the workbook.Open

Saving the Workbook5. We will begin by saving this file to the IT Skills folder on our (Y:) drive. To do this:

a. Click on the Office button at the top left-hand corner of the window.

b. Click on Save As to display the Save As dialogue box.c. If necessary scroll down the left-hand panel to display the list of available

drives. d. Click on the (Y:) drive in the list to select the drive and display its contents in the

right-hand panel.

e. In the right-hand panel locate the IT Skills folder, and then double-click on itto select it.

f. Ensure that the filename in the File name: panel is: New IS348PivotTables.xlsx

g. Click on to save the file and return to the workbook window. Save

Use of Lists6. PivotTables are based on a list of data in a worksheet. Although you can create a list

and enter data into it in much the same way as you do any Excel worksheet, it isimportant to adhere to the following rules:< The first row of the list must always contain a descriptive heading for each

column< The list must not contain any totally empty rows or columns within the list.

This is because Excel determines the boundary of a list by an empty row/column< The list should be kept self-contained, preferably by placing it on a separate

worksheet. If this is not possible ensure that there is an empty column to theright (and left if applicable) of the list and an empty row below (and above ifapplicable) the list

Viewing the List7. Before we begin to create the PivotTables it is useful to view the data that we are going

to use. To do this:a. Ensure that the Sales Data tab is selected.b. View the data, noting the name of each column and the type of data that each

contains.

Page 7: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Royal Holloway IT Department IS348 Introduction to Excel’s PivotTables

Page 3

Excel 2007 ViewClassic View

Creating a PivotTable8. We will now create a PivotTable based on this data. To do this:

a. Click anywhere within the list so that Excel is aware ofthe data that we wish to use.

b. Click on the Insert tab to the left of the Ribbon.c. Click on the PivotTable button (not the drop-down arrow)

in the Tables group at the left of the Ribbon.d. The Create PivotTable dialogue box displays.

e. In the Table/Range: panel ensure thatthe range selected is: ‘SalesData’!$A$1:$E$800

f. Under the Choose where you wantthe PivotTable report to be placedheading ensure that the NewWorksheet option button displays acheck mark, as we want the newPivotTable to display on a new worksheet.

g. Click on to close the CreateOK

PivotTable dialogue box.

h. A new worksheet displays with the PivotTable Field List on the right and anoutline structure for the PivotTable on the left.

Changing the PivotTable View9. Excel 2007 offers two different views for creating PivotTables:

< The Classic View which is the one used in Excel XP/2003< The Excel 2007 View which is the only view available on the later Excel 2010,

and optional on Excel 2007

10. To enable an easier progression to Excel 2010, these Session Notes use only the laterview. Therefore, if the Classic View displays it can be change to the Excel 2007 view asfollows:a. Ensure the worksheet is displaying the PivotTable Field

List.b. Ensure that the Options tab towards the right of the

Ribbon is selected.c. Click on Options in the PivotTable group at the left of

the Ribbon to display the PivotTable Options dialoguebox.

Page 8: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department

Page 4

d. Click on the Display tab.e. Click on the Classic PivotTable layout (enables dragging of fields in the

grid) tick box so that it does not display a tick mark.

f. Click on to close the PivotTable Options dialogue box.OK

Selecting the Headings (Fields)11. The PivotTable is laid out using four distinct areas: Row Labels, Values, Column Labels

and Report Filter. The way in which these work is as follows:< The Row Labels are fields from the underlying source data that are assigned a

row orientation in a PivotTable< The Values Fields are fields that contains data to be summarized

Note: Numerical values will by default be summed (added up)Non-numerical values will by default be counted

< The Column Labels are fields that will be assigned a column orientation in aPivotTable

< The Report Filter is a field that is assigned to a page, or filter, orientation. Therefore, a Report Filter produces a three-dimensional report that consists ofmultiple ‘pages’ each of which contains a subset of the data that is summarisedin the PivotTable

12. We are going to begin by producing a PivotTable that displays the Order amount foreach Salesperson. As a result, the headings (fields) that we are interested in using are:< Salesperson< Order Amount

13. In this case we need to sum the order amount for each salesperson, therefore theSalesperson field needs to be placed in the Row area and the Order Amount field in theValues area.

14. To insert these headings (fields) into the new PivotTable:a. In the PivotTable Field List on the right of the

window locate the Salesperson field under theChoose Fields to add to report: heading.

b. Then drag the field to the Row Labels panel at thebottom left of the dialogue box.

c. Now drag the Order Amount field under theChoose Fields to add to report: heading into the Values panel at the bottom right of the dialoguebox.

d. You should notice that as you add these field to therelevant panels the PivotTable on the left updates toshow the changes you have made.

e. View the data displayed in the PivotTable, you shouldnotice that you can easily see how much eachsalesperson has generated.

Improving the PivotTable’s Display15. If the PivotTable does not display as two distinct columns

you can change it so that it does. To do this:a. Click anywhere within the PivotTable to ensure it is selected.b. Click on the Design tab at the right of the Ribbon.

Page 9: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Royal Holloway IT Department IS348 Introduction to Excel’s PivotTables

Page 5

c. Click on Report Layout in the Layout group at the left of the Ribbon.

d. Select Show in Outline Form (or, if you prefer, Show in Tabular Form).

Renaming a Worksheet16. You should notice that the PivotTable has been created on a new worksheet, which

prevents the underlying data from being changed.17. It is probably worth renaming this worksheet so that it has a more meaningful name.

This is especially useful when you need to produce a number of different worksheets,possibly containing different PivotTables. To do this:a. Double-click on the PivotTable’s tab at the bottom of the window (probably

named Sheet1). b. Type the new name for the worksheet; In this case call it Sales PivotTablec. To accept the change press [Enter5].

d. Now save the Workbook again by clicking on the Save button .

Changing a Field’s Display18. We currently have the total value for each Salespersons’ Order Amount. However, we

may want to find out how many orders they processed in order to achieve this figure.

19. To do this we need to change the arithmetical operation from Sum to Count. To dothis:a. Click anywhere within the PivotTable to ensure that it is selected.b. Click on Sum of Order Amount in the

Values panel at the bottom of the PivotTableField List.

c. Click on Value Field Settings to display theValue Field Settings dialogue box.

d. Ensure that the Custom Name: panel statesSum of Order Amount as it is this field thatyou want to change to Count.

e. In the Summarize value field by panel clickon Count to select it.

f. Click on to close the Value FieldOK

Settings dialogue box and apply the change.

Adding Further Information20. If necessary you can add further fields to the PivotTable to get exactly the information

you require. For example we can display both the count and sum of the OrderAmounts so that we can see the amount each salesperson has taken along with numberof orders processed to achieve this.

Page 10: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department

Page 6

21. To do this: a. In the PivotTable Field List on the right of the window locate the Order

Amount field under the Choose Fields to add to report: heading.b. Then drag the field to the Values panel so it is just below the existing Count of

Order Amounts field.c. The PivotTable updates to show both Count of Order Amounts and Sum of Order

Amounts.

d. Save the Workbook again by clicking on the Save button .

Modifying the PivotTable22. We will now modify the PivotTable by including a Report Filter to display the Order

amount for each Salesperson in each country. To do this:a. Click anywhere within the PivotTable to ensure it is selected.b. In the PivotTable Field List on the right of the

window locate the Country field under theChoose Fields to add to report: heading.

c. Then drag the field to the Report Filter paneltowards the bottom left of the dialogue box.

d. You will notice that the PivotTable has beenmodified with the Country field being displayed atthe very top (in cell A1).

e. It appears that apart from the inclusion of theCountry field, the PivotTable has not changed inthe way it is displaying the data.

f. However if you now click on the down-arrow to theright of the Country field you will see that you havethe options (All), UK and USA.

g. Now filter the display to show the Order Amounts for only each UK Salesperson. To do this:(1) Click on the down-arrow to the right of the Country field to display the

options available.(2) Select the UK option by clicking on it.

(3) Click on to update the PivotTable and display just the UKOK

Salespersons’ Order Amounts.

h. Now redisplay All the Salespersons’ Order Amounts. To do this:(1) Click on the down-arrow (which now displays with a filter icon) to the

right of the Country field to display the options available.(2) Select the (All) option by clicking on it.

Page 11: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Royal Holloway IT Department IS348 Introduction to Excel’s PivotTables

Page 7

(3) Click on to update the PivotTable and display all the Salespersons’OK

Order Amounts.

Changing the PivotTable’s Column Headings23. The column headings within the PivotTable can be easily changed by clicking on the

heading to be changed and then making the edit in the Formula Bar (immediatelybelow the Ribbon).Note: The heading cannot be changed to any that are used in the underlyingworksheet, for example the Row Labels heading cannot be changed to (in this case)Salesperson.

Changing PivotTable Updates During Changes24. The PivotTable Field List enables you to select whether a PivotTable is automatically

or manually updated, for example when a field is added or removed. 25. Changing to the manual option may, for example, be necessary when there are a large

number of fields within the PivotTable and so becomes very slow to refresh after anychanges.

26. By default the option is set to automatically update to reflect any changes. However, ifyou need to change to manual update:a. Click within the Defer Layout Updates option box

at the bottom of the PivotTable Field List so that itdisplays a tick mark.

b. To update the PivotTable after adding or removing fields (headings) within the PivotTable Field List

click on the button at its bottom right-Update

hand corner.c. In this case automatic updates do not need to be disabled, so ensure that the

Defer Layout Updates option box does not display a tick mark.

Creating a New PivotTable27. We will now create another PivotTable, this one based on a set of data relating to

student accommodation. To do this:a. Click on the Accommodation Data tab to display a worksheet dealing with

students’ accommodation.b. View the data in the list, noting that it contains a number of students

(approximately 24), the College accommodation they are renting and the detailsof their payments for the last 3 terms. You should also notice that each term isin its own effective section, thus the student data is replicated 3 times, once foreach term.

28. When viewing this data it is useful to consider the questions we are likely to ask of it. Possible questions may be:< What is the total amount paid to date by each student< What was the date paid for each installment by each student< Which accommodation is each student renting< What was the date paid for each installment by each student and for which

accommodation

Page 12: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department

Page 8

29. We will now create a PivotTable based on this data in order to answer some of thesequestions. To do this:a. Click anywhere within the list so that Excel is aware of the

data we wish to use.b. Click on the Insert tab to the left of the Ribbon.c. Click on the PivotTable button (not the drop-down arrow)

in the Tables group at the left of the Ribbon.

d. The Create PivotTable dialogue box displays.e. As we previously clicked within our list

of data, Excel should have identified thecorrect Table/Range: of‘AccommodationData’!$A$1:$E$73.

f. We will create the PivotTable on a newworksheet, so under the Choosewhere you want the PivotTablereport to be placed heading ensurethat the New Worksheet optionbutton displays a check mark.

g. Click on to close the CreateOK

PivotTable dialogue box.

30. We are going to first produce a PivotTable that displays the student’s name andamounts paid to date.

31. Therefore the headings (fields) that we are interested in using are:< NAME< AM_PAID (Amount Paid)

32. To insert these headings (fields) into the new PivotTable:a. In the PivotTable Field List on the right of the

window locate the NAME field under the ChooseFields to add to report: heading.

b. Then drag the field to the Row Labels panel at thebottom left of the dialogue box.

c. Now drag the AM_PAID field under the ChooseFields to add to report: heading into the Valuespanel at the bottom right of the dialogue box.

d. You should notice that as you add these field to therelevant panels the PivotTable on the left updates toshow the changes you have made.

e. Save the Workbook again by clicking on the save button .

Adding to the PivotTable33. The PivotTable we have just produced gives a very basic display of the amount paid by

each student. However it does not answer such questions as did the student pay thewhole cost in one go, or over the three terms. In order to answer this question we needto modify the PivotTable. To do this:a. Click anywhere within the PivotTable to ensure it is selected.

Page 13: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Royal Holloway IT Department IS348 Introduction to Excel’s PivotTables

Page 9

b. We need to include the DATE_PAID option in thePivotTable. So to do this:(1) In the PivotTable Field List on the right of

the window locate the DATE_PAID fieldunder the Choose Fields to add toreport: heading.

(2) Then drag the field to below the NAMEfield in the Row Labels panel at the bottomleft of the dialogue box.

c. View the data displayed in the PivotTable, you should notice that the paymentdate for each student is now included, thus showing how and when they paid.

Improving the PivotTable’s Display34. If the PivotTable does not display as three distinct columns you can change it so that it

does. To do this:a. Click anywhere within the PivotTable to ensure it is selected.b. Click on the Design tab at the right of the Ribbon.c. Click on Report Layout in the Layout group at the left of the Ribbon.

d. Select Show in Outline Form (or, if you prefer, Show in Tabular Form).

Modifying the PivotTable35. That display is clearly useful, however it gives no detail about the accommodation each

student is renting, and so we need to include the ACCOMMODATION field (heading) inthe PivotTable.

36. To address this we will try adding the Accommodation field to the Report Filter. To dothis:a. Click anywhere within the PivotTable to ensure it is selected.b. In the PivotTable Field List on the right of the window locate the

ACCOMMODATION field under the Choose Fields to add to report:heading.

c. Then drag the field to the Report Filter panel towards the bottom left of thedialogue box.

Page 14: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department

Page 10

37. We will now Filter the PivotTable so that it displays all the students residing in Founders. To do this:a. Click on the down-arrow to the right of the

ACCOMMODATION field in cell A1 to display theoptions available.

b. Select the Founders option by clicking on it.

c. Click on to update the PivotTable and displayOK

all the students residing in Founders.

d. If we wanted to, we could repeat this process toselect another accommodation location from thedrop-down list and view the students residing there.

38. Although the current format may be suitable for some situations, it may be easier toview the accommodation location alongside each payment, which involves adding theACCOMMODATION field to the Row Labels panel.

39. Before we can do this we may need to make the Row Labels panel larger, so to do this:a. Point to the separator bar above the Drag fields

between areas below: heading in the PivotTableField List so that the cursor changes to a double-headed arrow.

b. Drag the separator bar up so the field listing area getssmaller and the four panels below becomes larger.

40. We can now add the ACCOMMODATION field to the Row Labels panel. To do this:a. In the PivotTable Field List on the right of the window locate the

ACCOMMODATION field in the Report Filter panel towards the bottom left ofthe dialogue box.

b. Then drag the field to below the DATE_PAID field at the bottom of the RowLabels panel at the bottom left of the dialogue box.

c. View the effects on the PivotTable’s display. Although this may be consideredmore useful for some needs than the last version we produced, it is not veryclearly laid out, with at least two potential areas that could be improved:(1) The ACCOMMODATION data may appear better to the left of the

DATE_PAID field(2) The Date subtotal is unnecessary in this situation

41. We will now incorporate these improvements into our PivotTable. To do this:a. Click anywhere within the PivotTable to ensure it is

selected.b. We want the DATE_PAID field to appear to the

right of the ACCOMMODATION field. c. Therefore, in the Row Labels panel at the bottom

left of the dialogue box, simply click and drag theDATE_PAID field so that it is below theACCOMMODATION field.

OR

Click on the down-arrow to the right of theDATE_PAID field in the Row Labels panel and select Move Down from themenu that displays.

Page 15: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Royal Holloway IT Department IS348 Introduction to Excel’s PivotTables

Page 11

Note: this illustrates how the order of the fields in the relevant areas indicatesthe position that they will appear in the PivotTable.

d. Save the Workbook again by clicking on the save button .

Hiding and Displaying Subtotals42. You should notice that the display is much clearer, and that the Date subtotal that we

identified earlier as being unnecessary has been removed as part of reorganising theRow Labels panel.

43. This thus highlights that as part of its data analysis, Excel attempts to display therequired data in the best way it can as well as adding what may be suitable analyticalfeatures such as subtotals, where it thinks appropriate.

44. However, subtotals ARE displaying for eachACCOMMODATION entry, which would probably be betterremoved. Therefore, to remove these subtotals:a. Click anywhere within the PivotTable to ensure it is

selected.b. Click on the Design tab at the right of the Ribbon.c. Click on Subtotals in the Layout group at the left of

the Ribbon.d. Click on Do Not Show Subtotals.

45. You should notice that the unwanted subtotals have now been removed. However, thetotal paid by each student has also been removed, which probably reduces thePivotTable’s usefulness.

46. To reinstate this total we need to change for the Field Settings for the Name field. To dothis:a. Click on the Name field in the Row Labels

panel at the bottom left of the PivotTableField List.

b. Select Field Settings to display the FieldSetting dialogue box.

c. In the Subtotals panel click on theAutomatic option button so that it contains acheck mark.

d. Click on to close the Field SettingsOK

dialogue box. You should notice that the totalpaid is now displayed alongside each studentsname.

e. Save the Workbook again by clicking on the Save button .

Renaming the Worksheet47. As the PivotTable has been created on its own worksheet it is probably worth renaming

it to have a more meaningful name. To do this:a. Double-click on the PivotTable’s tab at the bottom of the window (probably

named Sheet2). b. Now type the new name for the worksheet, which is: Accommodation

PivotTablec. To accept the name change press [Enter5].

Page 16: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department

Page 12

d. Now save the Workbook again by clicking on the Save button .

Updating the PivotTable Data48. Unlike charts, PivotTables are not automatically updated when the underlying data is

changed. 49. You may have noticed that the 29-09-07 entry for COSTELLO,RACHEL shows that she is

located in Williamson. This (for the benefit of today’s session) is incorrect, as she isspending the entire academic year in Butler, as the other two terms correctly show.

50. We will now investigate refreshing the data by correcting this inaccuracy. To do this:a. Return to the Accommodation Data worksheet by clicking on its tab.b. Locate cell C8, the cell containing Rachel’s accommodation location for the first

term, and overtype Williamson with the correct location, which is: Butler

c. Save the Workbook again by clicking on the Save button .

d. Return to the PivotTable by clicking on the Accommodation PivotTable tab.e. You should notice that the PivotTable has not been updated to reflect the change

you have just made.

f. To refresh the data to show the change:(1) Click anywhere within the PivotTable to ensure it is selected.(2) Ensure that the Options tab at the right of the Ribbon is selected.(3) Now click on the Refresh button in the Data group at

the centre of the Ribbon.(4) You should see that the data in the PivotTable is now

updated to show that Rachel is now located in Butlerfor the entire year.

Note: The data can also be refreshed in the following ways:(a) By pressing [Alt]+[F5].(b) By right-clicking on the PivotTable and selecting Refresh.

Hiding and Displaying Fields51. There may be occasions when your PivotTable contains data that you do not want

displayed but you do not wish to modify its actual structure. To deal with this situation,Excel enables selected areas of a PivotTable to be hidden. We will now examine someof the areas you can affect using this feature.

52. We will begin by hiding some of the payment details relating to COSTELLO,RACHEL, thefirst entry in the PivotTable.

53. To do this we will use the Expand and Collapse buttons that are normally located

to the left of the field entry, for example to the left of the Butler accommodation entry.

54. If these do not display, you will need to turn them on. To do this: a. Click anywhere within the

PivotTable to ensure it isselected.

b. Click on the Options tab tothe right of the Ribbon.

c. Click on the Expand/Collapse

button within the Show/Hide group at the right of the Ribbon.

Page 17: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Royal Holloway IT Department IS348 Introduction to Excel’s PivotTables

Page 13

55. To hide the payment details relating to COSTELLO,RACHEL, the first entry in thePivotTable:

a. Click on the Collapse button to the left of the Butler location for

COSTELLO,RACHEL.b. View the results, you should notice that the payment dates have been hidden for

all occurrences where the Accommodation is Butler. Additionally, the Totals forthese rows display a sum of the amount paid, rather than the individual amountsthat were previously displayed.

c. To redisplay the information relating to the Butler accommodation entries click

on the Expand button to the left of the Butler location for

COSTELLO,RACHEL. You should see that the payment dates and individualamounts paid have been restored.

d. You can also hide more detail if you wish to by right-clicking on a field. Todemonstrate this we will collapse the payment dates and amounts for allaccommodation locations.

e. To do this:(1) Right-click on any accommodation entry, for example the Butler location

for COSTELLO,RACHEL.(2) From the short-cut menu that displays select Expand/Collapse.

(3) From the further sub-menu that displays select Collapse Entire Field.(4) You should notice that all accommodation locations have been affected

by this change, rather then only Butler as occurred previously.

f. Using the same method you can also expand the display. We will now do this toreturn the PivotTable to how it appeared before we changed it. To do this:(1) Right-click on any accommodation entry, for example the Butler location

for COSTELLO,RACHEL.(2) From the short-cut menu that displays select Expand/Collapse.(3) From the further sub-menu that displays select Expand Entire Field.(4) You should notice that payment dates and amounts are now fully

displayed.

Page 18: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department

Page 14

Obtaining More Detail from the PivotTable56. When working with a PivotTable, it is frequently possible to obtain more detail than is

currently displayed, a term normally referred to as ‘drilling down through the data’. Inreality, what Excel is actually doing is to redisplay the data from the underlying list in amore user-friendly layout.

57. We will now examine this using the current PivotTable.a. Double-click on the first Amount Paid (1537.26) figure under the Sum of

Am_Paid heading for the student COSTELLO,RACHEL. b. A new worksheet is displayed containing all the relevant data for this student

from the underlying list:

c. Return to your PivotTable by clicking on the Accommodation PivotTable tab.

58. By clicking on a single payment in this way we obtained the full details relating to thatsingle payment. We can, however, obtain even more detail by being more selective ofthe data we select.

59. To demonstrate this we will now obtain details of all the payments this student hasmade. To do this:a. Double-click on the total Amount Paid (3833.89) figure under the Sum of

Am_Paid heading for the student COSTELLO,RACHEL. b. A new worksheet is displayed containing all the relevant data for this student

from the underlying list:

c. From this worksheet we can obtain all the available data relating to this student’spayments. Although the data is from the underlying list, it should beremembered that the list is in 3 distinct sections, i.e. a section for each term’spayment. Therefore this new worksheet offers a much easier format to use.

d. Return to your PivotTable by clicking on the Accommodation PivotTable tab.

Using the Headings’ Drop-Down Lists60. Depending on the heading, there are two types of list that can be obtained from the

drop-down arrow that is part of most PivotTable headings:< One format generally enables only one item to be selected from the list,

although it may include an option to select multiple items.< The other format enables as many, or as few, items as required to be selected.

61. To enable us to examine this we will move the Accommodation field back into theReport Filter panel. To do this:a. Locate the ACCOMMODATION field in the Row Labels panel at the bottom

left of the PivotTable Field List.b. Then drag the field into the Report Filter panel towards the bottom left of the

dialogue box.

Page 19: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Royal Holloway IT Department IS348 Introduction to Excel’s PivotTables

Page 15

62. To begin examining the different drop-down lists:a. Click on the down-arrow to the right of the

ACCOMMODATION field in cell A1 to display theoptions available.

b. Click on any of the options. You should notice that youcan select only one option at a time.

c. Therefore this type of list generally allows the selectionof only one (or all) item(s).

d. However, to overcome this limitation, Excel 2007frequently includes the option to select multiple items. To demonstrate this:(1) Click within the Select Multiple Items option button so that it display a

tick mark. The list of options now includes option buttons for you to entertick marks.

(2) To initially remove all tick marks click on All.(3) In this case we will display details for Kingswood and Reid Hall, therefore

enter a tick mark alongside the Kingswood and Reid Hall options.

(4) Click on to close the dialogue box and display the details for theOK

students residing in these locations.

e. Now make the PivotTable display all locations. To do this:(1) Click on the down-arrow (which now displays with a filter icon) to the

right of the ACCOMMODATION field again to display the optionsavailable.

(2) Click within the Select Multiple Items option button to remove thetick mark. The option panels alongside the list items are also removed.

(3) We want to display all locations, so click on All.

(4) Click on to update the PivotTable and display all theOK

accommodation options.

63. We will now examine the other type of list where more than one item can be easilyselected/deselected. To do this:a. Click on the down-arrow to the right of the DATE_PAID heading.b. You should notice that this list contains an entry for every item, in this case date,

that is contained within the underlying data. The tick box to the left of each itemdesignates whether the item is to be displayed, i.e. if it displays a tick mark theitem will be displayed. To hide an item click on the tick mark to remove it.

c. Click on the tick box for the third date down (29/09/07) to remove the tickmark.

d. Now click on to accept your change.OK

e. You will notice that all occurrences of the date 29/09/07 have been hidden,including the one for the first student, COSTELLO,RACHEL. This type of listthus enables you to include only the items that you want, from just one itemright up to all of them.

Formatting a PivotTable64. We will now consider several ways in which we can modify the appearance of our

PivotTable. The first area we will examine is the sort order of the data. a. The students’ Name field is currently sorted into an ascending order. To change

this to a descending order:

Page 20: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department

Page 16

(1) Click on the down-arrow to the right of theNAME field heading.

(2) From the menu that displays select Sort Z to A.(3) The PivotTable will now display with the

students’ name in a Z to A order. 65. Changing the sort order of one field does not exclude you doing so for other fields

(headings), so we will now change the order of the DATE_PAID field. To do this:a. Click on the down-arrow (which now displays with a filter icon) to the right of the

DATE_PAID field heading.b. From the menu that displays select Sort Newest to Oldest.c. You will see that the later dates now appear first for each student.

d. Save the Workbook again by clicking on the save button .

66. Another way in which you may need to format the data is so that it suitably displaysmoney. This can be done easily by using Excel’s Currency option. To do this:a. Right-click on the Sum of AM_PAID field

heading at the top left of the PivotTable.b. Select Number Format from the menu that

displays to display the Format Cellsdialogue box.

c. We need to apply a Currency format to thisdata, so in the Category: panel of theFormat Cells dialogue box, select theCurrency option.

d. You should also ensure that the Decimalplaces: text box displays 2 and theSymbol: text box displays a pound sign (£).Note: This dialogue box also enables you to change the number of decimalplaces that a ‘normal’ number displays. For example if you are performing aCount on some data you would want it to show no decimal places, and so youwould select Number from the Category: panel and change the Decimalplaces: text box to display a zero (0).

e. When you have completed applying the format that you want, click on toOK

close the Format Cells dialogue box and apply the change.

f. Save the Workbook again by clicking on the Save button .

Using the Column Option67. So far we have only made use of the Row Labels, Values, and Report Filter options

within our PivotTables. 68. We will now extend this by creating another PivotTable in order to examine the use of

the Column option.

69. To do this:a. Return to the Accommodation Data worksheet by clicking on its tab, and then

click anywhere within the list so that Excel is aware of the data we wish to use.b. Click on the Insert tab to the left of the Ribbon.c. Click on the PivotTable button (not the drop-down arrow) in the Tables group at

the left of the Ribbon.

Page 21: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Royal Holloway IT Department IS348 Introduction to Excel’s PivotTables

Page 17

d. The Create PivotTable dialogue boxdisplays.

e. Ensure that the Table/Range: panelcontains the range ‘AccommodationData’!$A$1:$E$73.

f. We will create the new PivotTable on a newworksheet, so under the Choose whereyou want the PivotTable report to beplaced heading ensure that the NewWorksheet option button displays a checkmark.

g. Click on to close the Create PivotTable dialogue box.OK

70. We are going to recreate the PivotTable that displays the student’s name and amountpaid, along with the Accommodation location. Therefore to do this:a. In the PivotTable Field List on the right of the

window locate the NAME field under the ChooseFields to add to report: heading.

b. Then drag the field to the Row Labels panel at thebottom left of the dialogue box.

c. Now drag the AM_PAID field under the ChooseFields to add to report: heading to the Valuespanel at the bottom right of the dialogue box.

d. Finally drag the ACCOMMODATION field underthe Choose Fields to add to report: heading into the Column Labels paneltowards the bottom right of the dialogue box.

e. Save the Workbook again by clicking on the save button .

f. If you now view the PivotTable you will probably find that the PivotTable FieldList gets in the way.

g. To hide this click on its Close button at the top right-hand corner of the

dialogue box.

h. View the PivotTable, noting the general layout and that there are totals for bothrows and columns. < The row gives the total amount paid by each student.< The columns displays the total amount received for each Accommodation

location.

i. This layout would therefore be very useful if you wanted to display eachstudent’s location AND the total amount generated by each location.

Page 22: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department

Page 18

71. However, we can further improve this layout by adding the DATE_PAID field, which wewill now do:a. We need to first display the PivotTable Field List. To do this:

(1) Click anywhere within the PivotTable to ensure it is selected.(2) Ensure that the Options tab at the right of the Ribbon is selected.(3) Now click on Field List that is in the Show/Hide group at the right of

the Ribbon.

b. In the PivotTable Field List on the right of thewindow locate the DATE_PAID field under theChoose Fields to add to report: heading.

c. Then drag the field so that it is above the NAMEfield in the Row Labels panel at the bottom left ofthe dialogue box.

d. View the layout. Notice that this new layout groupsthe payment by date, so displaying all students whopaid on each date.

72. If the PivotTable does not display with the date and student name as distinct columnsyou can change it so that it does. To do this:a. Click anywhere within the PivotTable to ensure it is selected.b. Click on the Design tab at the right of the Ribbon.c. Click on Report Layout in the Layout group at the left of the Ribbon.d. Select Show in Outline Form (or, if you prefer, Show in Tabular Form).

73. We will now modify the layout by repositioning the DATE_PAID field. To do this: a. Click anywhere within the PivotTable to ensure it is

selected.b. Click and drag the DATE_PAID field so that it is

below the Name field in the Row Labels panel atthe bottom left of the PivotTable Field List.

c. View the layout. Notice that the date each payment ismade is grouped together for each student thus giving a similar display to thatwe were working with earlier. However this layout also gives the total revenuegenerated by each accommodation location.

Page 23: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Royal Holloway IT Department IS348 Introduction to Excel’s PivotTables

Page 19

d. That completes the work on this PivotTable, so save the Workbook again by

clicking on the Save button .

Summarising More Complicated Data74. The data that you have been using enabled us to produce a PivotTable to achieve the

desired results very easily. However, some data does not lend itself to the production ofa PivotTable quite so easily. We are now going to look at the Questionnaire Resultsdata which although enabling us to produce a PivotTable to get the results you need, isnot as simple as it may first appear, and hence you will need to produce severalPivotTables in order to achieve the results you require.

75. In this example, you have a worksheet containing the results from a questionnaire whichwas completed by 350 people. To help aid you with this scenario you can view a sampleof the questionnaire which produced the resulting data on the next page.

76. The issues to note are:

< The questionnaire has a total of 4 questions, and each question has 5 possibleresponses.

< When the questionnaire is completed the results are sent to the owner in theform of: 1 = the 1st answer option, 2 = the 2nd answer option and so on.

< As a result we have a worksheet which displays a numerical response in relationto each question answered.

77. The data you want to summarise is how many people selected each answer option foreach of the four questions. You also want to find out what percentage of peopleselected each answer option. To obtain this information you need to create a PivotTablefor each question rather than one PivotTable for all the data.

78. Start by creating a PivotTable to count how many people selected each answer for

Question 1 (Quest 1). To do this:a. Display the worksheet Questionnaire Results by clicking on its tab.

Page 24: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department

Page 20

b. Click anywhere within the list of data so that Excel is aware of the data we wishto use.

c. Click on the Insert tab to the left of the Ribbon.d. Click on the PivotTable button (not the drop-down arrow) in the Tables group at

the left of the Ribbon.e. The Create PivotTable dialogue box

displays.f. Ensure that the Table/Range: panel

contains the range ‘QuestionnaireResults’!$A$1:$E$351.

g. We will create the new PivotTable on anew worksheet, so under the Choosewhere you want the PivotTablereport to be placed heading ensure thatthe New Worksheet option buttondisplays a check mark.

h. Click on to close the Create PivotTable dialogue box.OK

79. We want to calculate the amount of times each answer option was selected in Quest 1. The only field we need to calculate this is the Quest 1 field, which we will use in boththe Row Labels and Values panels. Therefore to do this:a. In the PivotTable Field List on the right of the

window locate the Quest 1 field under the ChooseFields to add to report: heading.

b. Then drag the field to the Row Labels panel at thebottom left of the dialogue box.

c. Now drag the Quest 1 field under the ChooseFields to add to report: heading into the Valuespanel at the bottom right of the dialogue box.

d. Save the Workbook again by clicking on the save

button .

e. View the new PivotTable. On the left-hand side isthe answer options available (1, 2, 3, 4 and 5) andon the right-hand side is the total number ofrespondents for each option.

80. If the PivotTable does not display with the question number and result as distinctcolumns you can change it so that it does. To do this:a. Click anywhere within the PivotTable to ensure it is selected.b. Click on the Design tab at the right of the Ribbon.c. Click on Report Layout in the Layout group at the left of the Ribbon.d. Select Show in Outline Form (or, if you prefer, Show in Tabular Form).

81. You should see that the PivotTable has defaulted to summarizing the data. We need toCount the responses not Sum them, so to change the Summarize option:a. Click on Sum of Quest 1 in the Values panel at the bottom right of the Pivot

Table Field List.

Page 25: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Royal Holloway IT Department IS348 Introduction to Excel’s PivotTables

Page 21

b. Click on Value Field Settings to display theValue Field Settings dialogue box.

c. Ensure that the Custom Name: panel statesSum of Quest 1

d. Also ensure that the Summarize by tab isselected.

e. Select Count from the Summarize valuefield by: panel.

f. Click on to close the Value FieldOK

Settings dialogue box and apply the change.g. Save the Workbook again by clicking on the

Save button .

82. We also want to find out the percentage of people who selected each answer in Quest 1in relation to the total number of respondents.

83. To achieve this we will add another copy of the Quest 1 field and then modify it todisplay as a percentage of the total amount.

84. To do this:a. Click anywhere within the PivotTable to ensure it is

selected.b. In the PivotTable Field List on the right of the

window locate the Quest 1 field under the ChooseFields to add to report: heading.

c. Then drag it to the Values panel at the bottom rightof the dialogue box so it is below the Count of Quest1 entry.

d. We now need to change this field so that it calculates the percentage for each

answer selected in relation to the total number of respondents. However, beforedoing that we need to change the summerize option to Count, so to do this:(1) Click on Sum of Quest 1 below the Count of Quest 1 entry in the

Values panel at the bottom right of the Pivot Table Field List.(2) Click on Value Field Settings to display the Value Field Settings

dialogue box. (3) Ensure that the Custom Name: panel states Sum of Quest 1(4) Also ensure that the Summarize by tab is selected.(5) Select Count from the Summarize value field by: panel.

e. We can now change this field so that it calculates the percentage for eachanswer selected in relation to the total numberof respondents. To do this:(1) Click on the Show values as tab.(2) Click on the down-arrow to the right of

the Show Values as panel to display alist of options.

(3) Scroll down the list and select the % ofcolumn option.

(4) Click on to close the Value FieldOK

Settings dialogue box.

Page 26: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department

Page 22

85. View the result of the modification. From this we can now see that for Question 1, 25people selected answer 1 which is 7.14% of the total respondents.

86. We have now completed our first PivotTable for the Questionnaire Results worksheet. Before we continue to create the second PivotTable we will name this worksheet so thatit has a more relevant name. To do this:a. Double-click on the PivotTable’s tab at the bottom of the window (probably

named Sheet5). The tab’s name will become highlighted to indicate that it canbe changed.

b. Now type the new name for the worksheet; in this case call it:Questionnaire PT

c. To accept the name change press [Enter5].

d. Now save the Workbook again by clicking on the Save button .

87. We will now create a second PivotTable to count how many people selected eachanswer in Quest 2 and also what percentage selected each answer in relation to thetotal number of respondents. To do this:a. Display the Questionnaire Results worksheet by clicking on its tab.

b. Click anywhere within the list of data so that Excel is aware of the data that wewish to use.

c. Click on the Insert tab to the left of the Ribbon.d. Click on the PivotTable button (not the drop-down arrow) in the Tables group at

the left of the Ribbon.e. The Create PivotTable dialogue box displays.f. Ensure that the Table/Range:

panel contains the range‘QuestionnaireResults’!$A$1:$E$351.

g. We will create this new PivotTable inthe worksheet Questionnaire PT sothat it is kept with the first (related)PivotTable. To do this:

h. Click in the Existing Worksheetoption button under the Choosewhere you want the PivotTablereport to be placed heading sothat it contains a check mark. Noticethat the Location: panel has become active. (1) We now need to indicate to Excel where it should position the new

PivotTable, so click on the worksheet Questionnaire PT, and then clickon cell A13, which is where we want the new PivotTable to start from.

(2) The Location: panel should now display 'Questionnaire PT'!$A$13

Page 27: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Royal Holloway IT Department IS348 Introduction to Excel’s PivotTables

Page 23

(3) Click on to close the Create PivotTable dialogue box.OK

88. We want to calculate the amount of times each answer option was selected in Quest 2. The only field we need to calculate this is the Quest 2 field, which we will use in boththe Row Labels and Values panels. Therefore to do this:a. In the PivotTable Field List on the right of the

window locate the Quest 2 field under the ChooseFields to add to report: heading.

b. Then drag the field to the Row Labels panel at thebottom left of the dialogue box.

c. Now drag the Quest 2 field under the ChooseFields to add to report: heading into the Valuespanel at the bottom right of the dialogue box.

d. Again drag the Quest 2 field under the Choose Fields to add to report:heading into the Values panel at the bottom right of the dialogue box so thattwo copies of this field are included in the panel.

e. Save the Workbook again by clicking on the save button .

f. View the new PivotTable. On the left-hand side is the answer optionsavailable (1, 2, 3, 4 and 5) for Question2, and on the right-hand side are thetwo columns displaying the totalnumber of respondents for each option.

g. We now need to change the Sum ofQuest 2 values to Count. To do this:(1) Click on top Sum of Quest 1

entry in the Values panel at thebottom right of the Pivot TableField List.

(2) Click on Value Field Settings todisplay the Value FieldSettings dialogue box.

(3) Ensure that the Custom Name:panel states Sum of Quest 2

(4) Also ensure that the Summarizeby tab is selected.

(5) Select Count from theSummarize value field by:panel.

(6) Click on to close the Value Field Settings dialogue box andOK

apply the change.

h. Save the Workbook again by clicking on the Save button .

Page 28: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department

Page 24

i. In a similar way also change the right-hand column of th PivotTable so that itCounts the data and displays the percentage of people who selected eachanswer in Quest 2 in relation to the total number of respondents. To do this:(1) Click on Sum of Quest 1 in the Values panel at the bottom right of the

Pivot Table Field List.(2) Click on Value Field Settings to display the Value Field Settings

dialogue box. (3) Ensure that the Custom Name: panel states Sum of Quest 2(4) Also ensure that the Summarize by tab is selected.(5) Select Count from the Summarize value field by: panel.

j. We can now change this field so that it calculates the percentage for eachanswer selected in relation to the totalnumber of respondents. To do this:(1) Click on the Show values as tab.(2) Click on the down-arrow to the right

of the Show Values as panel todisplay a list of options.

(3) Scroll down the list and select the %of column option.

(4) Click on to close the ValueOK

Field Settings dialogue box andcomplete the setting up of thisPivotTable.

k. You can now view the completed PivotTable.

l. Save the workbook again by clicking on the Save button .

Creating PivotCharts89. Once you have created a PivotTable it is relatively easy to create a chart based on it

using Excel’s PivotChart facility.

90. We will now investigate how to do this by creating a PivotChart based on theAccommodation PivotTable worksheet that we created earlier. To do this:a. Return to the Accommodation PivotTable by clicking on the Accommodation

PivotTable tab.b. Click anywhere within the PivotTable to ensure it is selected.

c. Ensure that the Options tab towards the right of theRibbon is selected.

d. Click on PivotChart in the Tools group towards the rightof the Ribbon to display the Insert Chart dialogue box.

e. In this case select the 3-D Clustered Column chart,which is probably the 4th option from the left on the top line.

Page 29: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Royal Holloway IT Department IS348 Introduction to Excel’s PivotTables

Page 25

f. Click on to create the chart.OK

g. We will not need the PivotChart Filter Pane that displays, so close it byclicking on its Close button.

h. You will probably agree that the chart that has been created is rather difficult toread. To improve this we can easily make changes to the underlying PivotTableby adding, removing, and reposition the fields within the PivotTable Field List. To investigate this:(1) Remove the Date_Paid field by dragging it out of the Axis Field panel

at the bottom left of the PivotTable Field List and onto the worksheet.(2) You should see that the chart, which now displays the total paid by each

student, is much easier to read.

(3) Now drag the Accommodation field from theReport Filter panel to immediately above theName field in the Axis Field panel.

(4) This chart now displays the total paid by eachstudent grouped by the Accommodation theyare staying in.

(5) To improve the chart’s display resize it bydragging one of the corner Sizing Handles.

(6) Now modify the display by dragging theAccommodation field from the Axis Field panelto the Legend Fields panel.

(7) The chart now shows the students’ location in amore graphical way.

(8) The last change we will make is to remove theName field by dragging it out of the Axis Fieldpanel and onto the worksheet. The chart nowdisplays the total amount paid for eachAccommodation.

91. It should also be noted that the chart can be modified in many of the same ways as a‘normal’ Excel chart, including: < Moving it to its own Chart Page < Adding chart and axis titles< Changing the chart type< Changing the chart’s/data point’s colours

Consolidation Exercises92. To consolidate what you have learnt in this session you should now complete the

following short exercises:a. Produce the remaining two PivotTables for Quest 3 and 4 in the Questionnaire

Results.

b. Save the Workbook again by clicking on the Save button .

c. Produce a PivotTable based on the Accommodation Data to display the totalamount of revenue generated by each degree type (DEGREE_TITLE) andaccommodation location.

Page 30: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department

Page 26

It is suggested You try (and compare) the following layouts:(1) Degree Title in Row Labels/Fields

Accommodation in Column Labels/FieldsAmount Paid in Data/Values

(2) Degree Title, Accommodation and Name in Row Labels/FieldsAmount Paid in Data/Values

(3) Degree Title in Row Labels/FieldsAmount Paid in Data/Values

d. Create a PivotChart for each of the options for step C. above and then consider usefulness of each resultant chart.

e. Save the Workbook again by clicking on the Save button .

ConclusionIn this session we have examined how to produce a number of PivotTables. We alsoconsidered a number of ways in which they can be modified to better suit our needs, includingthe addition and removal of subtotals, hiding unwanted data, and the application of theCurrency format. We have also examined how we can produce charts using the PivotChartfacility.

Page 31: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

Royal Holloway IT Department IS348 Introduction to Excel’s PivotTables

Page 27

Accessing the IT Training Exercise Files and (Y:) drive from your own PC/Laptop

93. In order to access the files required to complete many of the IT Training exercises youneed to access a shared drive, referred to as the (R:) drive in the notes. Theseinstructions give details on how to connect to this drive, for example from your home,along with details on how you can also set up access your (Y:) drive.

Note: If using a Mac, instructions on setting up Campus Anywhere (VPN) can be foundat: http://www.rhul.ac.uk/IT/CampusAnywhere/Instructions on mapping to the (R:) drive and (Y:) drive can be found at:http://www.rhul.ac.uk/it/faq/itfaqs/mac/mapnetworkdrive.aspx

a. If working on Campus ensure that you are connected to CampusNet.

OR

If working off Campus ensure that you are connected to the Internet and thatyou have connected to Campus Anywhere (VPN).Note: To obtain instructions on how to set up Campus Anywhere (VPN) visit:

http://www.rhul.ac.uk/IT/CampusAnywhere

Accessing the (R:) DriveImportant: If your PC already has an (R:) drive you will need to select a different letter in thefollowing instructions.

b. Begin by displaying Windows Explorer. To do this:

(1) Click on the Start button to open the Start Menu.

(2) Click on Computer to the right of the Start menu.

OR

Press the Windows key at the right of the keyboard and with it still depressedpress E on the keyboard.

c. With Windows Explorer open click on Tools.

d. Select Map Network Drive to open the Map Network Drive dialogue box.

e. Click on the drop-down arrow to the right of the Drive: panel and select R: (orany letter of your choice if that already has an entry, and so already allocated).

f. In the Folder: panel enter the mapping for the (R:) which is:\\ourdata.rhul.ac.uk\teaching\PCLabs

g. Ensure that the Reconnect at logon box displays a tick mark. If it does not,click within it so that it displays one.

h. Click on [Finish] to complete the setting up. You should now be able to see the(R:) drive containing the IT Training files.

Accessing the (Y:) DriveYou can also access your (Y:) drive using the same method, but taking note of the following:

a. If your PC already has an (Y:) drive you will need to select a different letter instep e.

b. In step f the path that you must enter is: \\mydata.rhul.ac.uk\home\

Note: When accessing these drives you may be prompted for your username and password. Ifthis occurs you must prefix your username with cc\For example, if your username is zhaa666 then you must enter cc\zhaa666.

Page 32: IS348 An Introduction to PivotTables Using Excel 2007 · IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department Page 2 c. If necessary scroll down in the left-hand

IS348 Introduction to Excel’s PivotTables Royal Holloway IT Department

Page 28