Comp1703 Weeknine
Comp1703 Weeknine
Computers
for Healthcare
Professionals
Instructor: Dan Barlow
Agenda
• Freezing Panes
• Creating/Using Tables
• Sorting Data
• Filtering Data
• Reviewing the IF() Function
• COUNTIFS(), SUMIFS(), and AVERAGEIFS()
Freezing Panes
• Freezing Panes allows you to specify a range of Rows and/or Columns that you would
like to see at all times, even while scrolling through your data.
• This is especially handy when you have rows that contain column headings and
columns that contain uniquely identifying data (employee name for example).
• You can find the Freeze Panes Button in the Window Group of the View Tab.
• The first option, “Freeze Panes / Unfreeze Panes” (depending on whether or not any
Panes have already been frozen) will freeze all Columns to the left of the currently
selected Cell, and all Rows above the currently selected Cell.
If you wanted to freeze Rows 1:10, and columns A:C, select Cell D11 and click “Freeze Panes”. To
undo your frozen panes, click “Unfreeze Panes” (same button, new name).
• The other two options Freeze the first Row and the first Column respectively (you must
pick one or the other, use the Freeze Panes method above to get both).
Creating Tables
• Tables allow you to organize your data so that it is easier to sift
through.
• Tables also allow you to Sort or Filter your data so that you can
group similar pieces of data together or temporarily hide unneeded
data, respectively.
• To create a Table, you can select any Cell within all of the data that is
to be included in the Table (ensure there are no blank Columns or
Rows as these will end the Table), and in the Tables Group on the
Insert Tab, click the Table Button. This will bring up the Create Table
Dialog.
• Ensure that the range of Cells shown is correct. Adjust if necessary.
• If your data already contains Column Headers in the first Row, the
“My table has headers” option should be checked by default. This
tells Excel that there is no data in that Row, just headings.
Creating Tables
• When you hit OK on the Create Table Dialog, your Table will be created with one of the
default Table Styles.
• Take note of the Table Tools > Design Tab, the Table Name Property, and the
Checkboxes in the Table Style Options Group.
Creating Tables Cont.
• The Table Tools > Design Tab appears when you have a Table selected and allows you to
dictate the way the Table appears (you can ignore the other options for now).
• The Table Name Property allows you to specify the name of your Table. Choose a name
that is descriptive of the data contained in the Table (a name like the default “Table1”
will never be acceptable).
Creating Tables Cont.
• In the Table Style Options Group you can specify whether or not there is
a Header Row (Row 1 in the screenshot is a Header Row),
a Total Row (a special Row at the bottom of a Table that calculates totals for numeric Columns),
banded Rows (alternating Row colours, as shown below), or Banded Columns (alternating Column
colours),
highlighted first or last Columns,
a Filter Button in the Header of each Column (as seen below, drop down arrows in each Header).
Sorting Tables
• Sorting allows you to temporarily re-arrange the order of the
Rows based on criteria that you can specify.
• Sorting is typically applied to the values in a Column.
• You can apply Sorting to a Column by selecting any Cell in that
column and clicking the Sort and Filter Button in the Editing
Group of the Home Tab.
• You are given a number of Sorting options:
Sort A to Z (alphabetical order, ascending),
Sort Z to A (alphabetical order, descending),
and Custom Sort (specify multiple layers of Sorting and on which
Columns each Sort will be applied).
• Choosing Custom Sort bring up the Sort Dialog.
The Sort Dialog
• The Sort Dialog allows you to specify multiple levels of Sorts to apply to your Table.
• You must manually add the levels by clicking the Add Level Button (you can add as many as
necessary, I have added 2 for a total of 3 levels in the screenshot below).
• Note that sorting happens sequentially, the data is Sorted by the first criteria in the list, then by the
second, the third, etc…
• In this example I have stated that the
data must be Sorted in the following way:
First, Sort all values in the “Artist” Column
alphabetically, ascending.
Next, Sort all values in the “Title” Column
alphabetically, descending.
Finally, Sort all numeric values in the
“Appraised Value” Column from the Largest
to the Smallest value.
Filtering Tables
• Filtering allows us to temporarily remove entire Rows
when certain criteria (that we specify) are met.
• By clicking on the Filter Buttons that are in the Column
Headers we are presented with a list of values that exist in
that Column as well as some other options.
• To perform a Simple Filter we can Check/Uncheck the
Check Boxes next to each value to Show/Hide any Rows in
which that value exists.
• To create a more Advanced Filter that specifies some
criteria we can choose the Value Dependent Filters option
(if the values in the currently selected Column are text,
this will be the Text Filters option, if they are Dates this
will be the Date Filters option, etc).
Advanced Filters
• No matter which option you choose from the secondary list of the Value Dependent Filters
option (Text Filters in the previous screenshot) you will launch the Custom AutoFilter
Dialog which will allow you to specify the criteria for Filtration.
• In this example I Filtered the “Title” Column so that any Title that contains the letters “be”
will be shown, OR any title that is equal to the text “amen” will be shown. The OR option
provides multiple results because it is more inclusive (it can be this OR that). Remember,
“Or is more”!
• The AND option is more exclusive and produces fewer results (it must be this AND that).
Remember, “And is bland”!
• There are multiple different criteria
available for the different types of
values (Text, Numbers, Dates, etc…)
Explore the Dropdowns in this Dialog!
Reviewing the IF()
Function
• Recall that the IF() Function allows us to ask • We can specify many different things to be
Excel a question about some of our data, and displayed in either case, including:
the response is always either True or False. • Exact Text
• We need to compare two values, usually a Cell • An Exact Number
reference compared to some value we expect to • The Result of a Function
find in that Cell (F2 = “Hello”, is the value in Cell • The Result of a Formula
F2 the same as the text “Hello”). • Or Any Combination of the Above
• To compare values we use the Relational • IF() Function Structure: =IF(Comparison,
Operators: ValueIfTrue, ValueIfFalse)
• < Less Than • Example: Matthews English Grade is in Cell D2
• <= Less Than OR Equal To and it has a value of 42% what will be displayed
• > Greater Than in the current Cell if it contains the following IF()
• >= Greater Than OR Equal To Function:
• = Equal to • =IF(D2 < 50%, “Work Harder!”, “Nice Job!”)
• <> Not Equal To
• Answer: Work Harder! (Matthews grade was
• Next we must specify the value to display in the less than 50%, so our comparison was true)
current Cell if the answer to our comparison
was true, followed by the value to display in the
COUNTIFS()
• The COUNTIFS() Function allows us to count how many Rows
exist that contain value(s) which meet criteria that we must
specify.
• The difference between COUNTIF() and COUNTIFS() is that in
COUNTIFS() we can specify more than one set of criteria.
• The easiest way to get started creating a COUNTIFS()
Function is to select a Cell to place the Function in, then use
the Insert Function Button at the top of the work sheet (next
to the Formula Text Box).
• This launches this Insert Function Dialog. Use the search
option to look for the COUNTIFS() Function, then select it
from the list (note the description of the function at the
bottom of the Insert Function Dialog).
• Selecting the Function and hitting OK opens the Function
Arguments Dialog.
COUNTIFS() Cont.
• In the Function Arguments Dialog we can specify the Range of the criteria (the Cells where
we will look for a particular value) and the criteria itself (the comparison we will make).
• It is important to note that all Ranges must be Absolute References, and all comparisons
must be contained in double quotes here.