Intro To Information Technology: Tables, Functions, and Pivot Tables Microsoft Excel
Intro To Information Technology: Tables, Functions, and Pivot Tables Microsoft Excel
Objective
The objective of this workshop is to introduce you to some of the more advanced techniques that
can make using a spreadsheet more productive. In doing this you will learn how to use a
spreadsheet’s Table features, some useful functions, and how to create a Pivot Table and modify it
so that it better suits your needs.
Tables
To make managing and analysing a group of related data easier, you can turn a range of cells into a
Microsoft Office Excel table. A table typically contains related data in a series of worksheet rows
and columns that have been formatted as a table. By using the table features, you can then
manage the data in the table rows and columns independently from the data in other rows and
columns on the worksheet.
When you create a table in an Excel worksheet, it's not only easier for you to manage and analyse
its data, but you also get built-in filtering, sorting, and row shading. Using an Excel Table allows
you to do a number of things with your data, including:
• Entering data into the table
• Filtering the table to display only the rows that meet the criteria you specify
• Creating formulas to calculate results on the table filtered by your applied criteria
• Sorting the table
Using Tables
Specifying a Table
You can either create a table and then enter the data, or you can turn a pre-existing list into a
table. You will do the latter:
1) Select the Table Example worksheet by clicking on its tab at the bottom of the window
You can either select the range of cells you want included in the table (the cells can be empty
or can contain data) or you can let Microsoft Excel determine the boundary of a table by an
empty row and/or column. You have a clearly defined range of data, so you will let Excel
determine the table boundaries by clicking anywhere on your spreadsheet in the range of cells
which contain data.
2) On the Home tab Styles group, click Format as Table
3) Under Light, Medium, or Dark, click the table style you want to use. If the selected range
contains data you want to use as table headers, click a table style that includes a header row.
The Format As Table dialogue box opens showing the cell range for the data in the table which
Excel has guessed.
4) If the top row of the selected range contains data you want to use as table headers, make sure
there is a tick in the My table has headers box
5) Click OK
You will see that there are now drop-down filter arrows in the header for each column, and
the table itself has been shaded to distinguish it as such.
Filtering a Table
Spreadsheets usually provides two methods to filter a table; AutoFilter which is used for simple
filtering criteria and Advanced Filter which is used for more complex filtering.
You will now perform a filter on a table to find some information about students undertaking
certain courses.
1) AutoFilters are created on each column in a table when you specify it as such. Use the filter to
display the data on all students who undertook a Classics Degree. Therefore the filter to apply
is Classics from the Degree Column. To do this:
a) Click the drop-down arrow alongside the column you wish to use as the main filter: Degree
b) By default all possible values for degree are shown and selected. Click (Select All) to
unselect them.
c) Select the filter term you want from the drop-down menu: Classics and then click the OK
button. The drop-down arrow box will change to show a small filter symbol to indicate that
it is an active filter.
The table is displayed showing only the rows that correspond to the filter criteria you have
selected, in this case the eight students taking a degree in Classics.
2. Create another AutoFilter on the table. This time the filter should display the data on all
students who have the surname Smith and undertook a Classics Degree. Therefore, the filter
to apply is Smith from the Surname Column and Classics from the Degree Column:
a) Click the drop-down arrow alongside the column you wish to use as the main filter:
Surname.
b) Click in the search box and start typing the word Smith. By the time you have typed “m”,
you will find that Smith is the only name that appears on the list so you can now click OK to
accept this filter.
c) Set the filter for Degree to be Classics as before.
3. View the results of your filter (two students named Smith who are taking a degree in Classics,
and then redisplay the complete table again (second method):
a) On the DATA tab Sort and Filter group, click Clear.
4. Create an AutoFilter on the table to select the best five student results.
a) Click the drop-down arrow alongside the column you wish to use as the main filter: Result.
b) Click Number Filters and then Top 10. The
Top 10 AutoFilter dialogue box opens.
c) In the middle box which shows numbers, change 10 to 5 and click OK.
d) The best five student results are displayed. Clear the filter using either method.
Syntax
=IF(logical_test, [value_if_true], [value_if_false])
b) Click on cell F2 and then on the Insert Function button to open the Insert Function
dialogue box
c) In the Search for a function: box type IF and click Go
d) Select IF from the Select a function box: below and click the OK button to open the
Function Arguments dialogue box
e) Click in the Logical_test box and then click cell E2. Because you are in a table, it will put
[@Result] into the box so that the entire column of the table will be tested. At the end of
this type >=40. This box should now read: [@Result]>=40
f) Click in the Value-if-true box and type “Pass” (if you forget the quotation marks it will put
them in for you automatically)
g) Click in the Value-if-false box and type “Fail”
h) Click OK
This tutorial has lots more information on more advanced ways to use IF, including nesting
IF functions: https://trumpexcel.com/excel-if-function/
Syntax
=COUNTIF(range, criteria)
Input Arguments
• Range – the range of cells for which you want to evaluate against criteria1
• Criteria – the criteria which you want to evaluate for criteria_range1 to determine which
cells to count
b) Click on cell F84 and then on the Insert Function button to open the Insert Function
dialogue box
c) In the Search for a function: box type COUNTIF and click Go
d) Select COUNTIF from the Select a function box: below and click the OK button to open the
Function Arguments dialogue box
e) Click in the Range box and type F2:F81
f) Click in the Criteria box and type “Pass”
g) Click OK
Challenge: in the row below, construct a COUNTIF function to count how many students have
failed.
The VLOOKUP function (V stands for 'Vertical') is best suited for situations when you are looking
for a matching data point in a column, and when the matching data point is found, you go to the
right in that row and fetch a value from a cell which is a specified number of columns to the right.
Remember when paper exam result lists were pinned up on a notice board, and you had to try to
find your name and result. You went to the notice board and started looking for your name or
enrolment number, and when you found it, you moved your eyes to the right of the
name/enrolment number to see your marks. That is exactly what the VLOOKUP function does for
you. The VLOOKUP function looks for a specified value in a column (in the above example, it was
your name) and when it finds the specified match, it returns a value in the same row (the marks
you obtained).
Input Arguments
• lookup_value – this is the look-up value you are trying to find in the left-most column of a
table. It could be a value, a cell reference, or a text string. In the exam result sheet
example, this would be your name.
• table_array – this is the table array in which you are looking for the value. This could be a
reference to a range of cells or a named range. In the exam result sheet example, this
would be the entire table that contains result for everyone for every subject
• col_index – this is the column index number from which you want to fetch the matching
value. In the result sheet example, if you want the result (which is the last column in a
table that contains the results), you’d look in column 5. If you wanted the degree the
student was taking, you’d look in column 3.
• [range_lookup] – here you specify whether you want an exact match or an approximate
match. If omitted, it defaults to TRUE – approximate match.
b) Click on cell H3 and then on the Insert Function button to open the Insert Function
dialogue box.
c) In the Search for a function: box start to type VLOOKUP and then select VLOOKUP from
the Select a function box: below.
d) Click the OK button to open the Function Arguments dialogue box.
e) In the Lookup_value box type H2 to indicate that the value which needs to be looked up or
searched, is present in the cell H2.
f) In the Table_array box you need to put the block of values that need to be searched. In
Excel, this block of values is known as the ‘table array’ or the ‘lookup table’. The value
corresponding to the lookup_value must appear within the first column of this table. The
lookup table is from cell reference A1 to E80, that is the complete block where the
corresponding value would be searched. So click in the Table_array box and either type in
A1:E80 or click and drag from cell A1 to E80.
g) In the Col_index_num box you need to put in the column reference which notifies
VLOOKUP where you expect to find the data you want to view. In this case, the column
reference would be 5 as the Result column is column 5 in the lookup table A1:E80. So type
5 into the Col_index_num box.
h) In the Range_lookup box you need to tell the VLOOKUP function whether we want an
approximate match or an exact match to the specified lookup value.
• FALSE: Refers to Exact Match
• TRUE: Refers to Approximate Match
In this case, we want the exact match ('FALSE' keyword). So type FALSE into the
Range_lookup box.
The final VLOOKUP formula will be: =VLOOKUP(H2,A1:E80,5,FALSE)
i) Click OK
You will see 61 in cell H3 because that is the matching Result value for the student with
surname Bowyer which is in cell H2.
You can easily use VLOOKUP to look up information which is on another sheet by clicking on the
tab for the other sheet and then choosing the appropriate table array at stage (f) above.
If you use TRUE for Range_lookup at stage (h) above for an approximate match, you must make
sure that the table array is sorted using the column indicated in the col_index_num box.
This tutorial has lots more information on more advanced ways to use VLOOKUP:
https://trumpexcel.com/excel-vlookup-function/. For great tutorials with examples for many more
Excel functions, try here: https://trumpexcel.com/excel-functions/.
Pivot Tables
What is a Pivot Table?
In its simplest form, a pivot table is a summary of an Excel table. However, in reality it is a
collection of analytical tools that lets you quickly create summary information with the ability to
sort, filter, group, and rearrange data to suit your particular need. Although you can create a pivot
table that does not summarise numerical information, most pivot tables are focused on numbers.
However, it is perfectly feasible, for example, to create pivot tables that merely provide counts of
entries.
• Pivot tables are interactive, that is, you can easily rearrange them by moving, adding, or
deleting fields
• Pivot tables are dynamic, which means that results are automatically recalculated
whenever fields are added or removed, or categories hidden/displayed
• Pivot tables are easy to update if the original worksheet data is changed
Before you begin to create the Pivot Tables it is useful to view the data that you are going to use.
To do this select the Sales Data worksheet tab. View the data, noting the name of each column
and the type of data that each contains.
You are going to produce a Pivot Table that displays the Order amount for each Salesperson. As a
result, the headings (fields) that you are interested in using are: Salesperson and Order Amount
is changed. Therefore, to update a Pivot Table you must click the Refresh Data button on
the PivotTable ribbon whenever you have changed the underlying data. In this case, the
underlying data is on a different worksheet, so you would have to return to that sheet to change
the data, and then move back to the sheet with the Pivot Table to refresh it.
3) Can you think of other uses for the functions introduced in this session?
4) What is a Pivot Table and what are the advantages of using one?
ON YOUR OWN
Driver Distribution specialises in distributing fresh produce to local restaurants in the Birmingham
area. The company currently sells 12 different products through the efforts of three sales
representatives to 10 restaurants. The company, like all small businesses, is always interested in
finding ways to increase revenues and decrease expenses. The company’s founder, Dave Driver,
has recently hired you as a new business analyst. Dave is eager to hear your thoughts and ideas on
how to improve the business and help the company build strong lasting relationships with its
customers.
Dave has provided you with last year’s sales information in the file DriverSales.xlsx. Open the file
DriverSales.xlsx from the VLE, click Enable Editing at the top of the page and save it to your
device.
Help Dave analyse his distribution company by creating and using five pivot tables to determine
the following: