1. CHAPTER 7:
AND PIVOT TABLE
2. DESCRIPTIVE STATISTICS
• A collection of quantitative measures and ways of
• Example: Frequency distributions, histogram,
measures of central tendency (mean, median,
mode, proportion) and measures of dispersion
(range, variance, standard deviation)
3. DESCRIPTIVE STATISTICS
• Excel provides a useful tool for basic data analysis,
available under the Data Analysis ToolPak from the
• Descriptive statistics can also be computed by
entering statistical functions directly in worksheet
*open template: Exercise !!!
click Tool, choose Add Ins
click the Analysis ToolPak box, press OK
click Tool, choose Data Analysis
choose Descriptive Statistics, press OK
highlight the column that contain the data
tick Output Range and highlight the empty
cell that you wish to place the result
tick the Summary statistics box, press OK
• A quick and easy way to extract certain records
from a database created in Excel.
• The filtering makes it possible to manipulate the
records as a group of their own.
• Unlike sorting, filtering does not rearrange the list,
instead it hides the rows containing the records that
do not meet the criteria.
Create new record in Excel (show at least 3
column of data): example – Month, Brand, RM
or Name, Subject, Marks
2nd: Point at the first column title, choose Data
3rd: Choose Filter, then AutoFilter
4th: Examine the effect to the record
7. ADVANCED FILTERING
• Can be used to create a separate table of record
from the main record.
• There are 6 standard Comparison Operators
(=,>,<,<=,>= and <>) to be used to set the criteria for
• Syntax to set the criteria for text: =“=text”
• Excel will match the content with the text type by
• The asterisk (*) and question (?) mark are wildcard
8. • They are used in criteria statements to represent
one or more characters.
=“=?an” would return Dan, man and fan
=“=*an” would return man, woman, American
* stop the AutoFilter features for the current record
create new table (with the same column title)
place the criteria in the cell below the column
title of the new table
3rd: highlight the whole record including the
4th: choose Data  Filter  Advanced Filter
5th: for Criteria range:, highlight the new table
containing the criteria (including the column title)
tick copy to another location
for Copy to:, point at any empty cell that you
wish to place the new projected table
examine the result
11. PIVOT TABLE
• A tool useful for summarizing the variables
contained in an Excel sheet.
• Located in Data menu.
• Be sure to provide a variable label at the top of
each column in the worksheet, because labels are
necessary when constructing a pivot table.
• Why Pivot?
to summarize data contained in lengthy list
into a compact format
to find relationships within the data
to organize data into a format that’s easy to
12. TO CREATE PIVOT TABLE
Select cell in the worksheet
that contains data, or select
all the data and columns
you want to include in the
report. On the Data menu,
click PivotTable and
In Step 1 of the wizard, make
sure that Microsoft Excel list
or database is selected.
Under What kind of report do
you want to create?, make
sure that PivotTable is
13. PIVOT TABLE
Select the data Range you wish to include in your PivotTable
 $A$1:$H$24 (cells that contain your data)
 Sheet1!$A:$H (columns that contain data)
 MyData (a named range that contains data)
14. PIVOT TABLE
Select where you want your PivotTable to reside (the default is a
new worksheet within this workbook)
The create your PivotTable, either click Layout or Finish
Note: If you get
message and you
about file size,
15. PIVOT TABLE
• Remember the rules of where to place data fields:
• Row Fields: display data vertically, in rows
• Column Fields: display data horizontally, across columns
• Data Items: numerical data to be summarized
• Page Fields: display data as pages and allows you to filter to a
• Note: If the field list is hidden, click Show Field List on the PivotTable
• 2 ways to update:
• Use the layout option in the Wizard
• Or, create an empty PivotTable and drag in fields from the field list
• Rename the fields in the gray boxes. Click the field name, retype,
and then press ENTER.
• Format Numbers:
• Click a cell that contains numerical data, or the name of the field
heading for that data.
• Click the Field Settings button on the PivotTable toolbar, and then
• In the Format Cells dialog box, click any option in the Category list.
• Click OK twice.
• You may use cell formatting buttons
• Note, hover at column or row beginning until you get a black
arrow to select that column or row before applying the format
• Apply an automatic format
• Click in the report, and then click the Format Report button on the
• Select a format in the AutoFormat dialog box
• Select PivotTable Classic to remove auto formats
• Generally apply auto formats as a last step
18. CHANGE THE DISPLAY
• Change sort order
• Click the field heading or any cell in the list that contains the data
you want to sort.
• On the PivotTable toolbar, click PivotTable, and then click Sort and
• Under AutoSort options, click Descending or Ascending.
• Click OK.
• Change how data is summarized
• Click a cell in the data area or the field heading for the data area.
• Click the Field Settings button on the PivotTable toolbar.
• In the Summarize by list, click an option, and then click OK.
19. ADD FIELDS
• Drag in fields from the PivotTable Field List or return to the PivotTable
Wizard and click Layout
• If the PivotTable Field List is not visible, click on the report
• You don't have to undo an existing report to add another field
• More than one field can be dragged onto any of the drop areas on
• A PivotTable report with more than one row field has one inner row
field (closest to the data area) and other outer row fields
• Items in the outermost row field are displayed once; items in the
rest of the row fields are repeated as necessary
• Any field can be used more than once on a report, even in the
same drop area
20. CALCULATION OPTIONS
• Use a summary function other than SUM
• Click the data field heading or a cell within the data field, and
then click the Field Settings button on the PivotTable toolbar.
• In the Summarize by list, select a different summary function, and
then click OK
• Use a custom calculation* to show data another way
• Click in one of the cells in the data area
• On the PivotTable toolbar, click the Field Settings button
• Click the Options button
• In the Show data as list, click the arrow, scroll down the list, and
then make a selection such as % of total. Click OK.
* Use with caution. Make sure you are getting expected results.
21. CALCULATION OPTIONS
• Use calculated fields* or calculated items* to enter your own
formulas based on the information in the data area in a PivotTable
• Calculated field: when using data from another field in your
• For example, compute student/faculty ratio when student
count and faculty count are two separate fields
• Calculated item: when using data from one or more specific items
within a field
• For example, compute % of students that are female when
gender is one field
* Use with caution. Make sure you are getting expected results (for
example, does your total row sum the percentages or recalculate
22. CHANGE THE DATA
• After changes are made to the information source, click the Refresh
• If you have added columns or rows to your data source, make sure
to update the data range
• Right click on the PivotTable, click PivotTable Wizard, click the
• Note, if you insert rows into your current data range, the PivotTable
will automatically update
23. CELL REFERENCES
• GETPIVOTDATA function appears automatically when you type an
equal sign (=) outside of the report and then select a cell inside the
• GETPIVOTDATA function retrieves data from the report and
continues to do so even if the report layout changes.
• If you remove any of the fields referenced in the GETPIVOTDATA
formula from the report, the formula returns #REF!.
• If you do not want to use the function:
• Type an equal sign (=) in a cell outside of the report.
• Type the cell address that contains the value that you want to
24. CELL REFERENCES
• You can also add a button to the PivotTable toolbar to turn the
GETPIVOTDATA function on and off.
• With a PivotTable report open, on the PivotTable toolbar, click the
Toolbar Options arrow on the right end of the toolbar.
• Click Add or Remove Buttons, click PivotTable, and then click
• When you click in your worksheet, you'll see the Generate
GetPivotData button on the toolbar. When selected, the button
turns the function on. Select the button to turn the function on or