Tutorial 7: Using Advanced Functions and Conditional Formatting

advertisement
Abdul Hameed
http://Informationtechnology.pk
Using Advanced Functions and
Conditional Formatting
Microsoft Office Excel 2013
®
®
Objectives
•
•
•
•
•
•
XP
Use the IF function
Use the AND function
Use the OR function
Use structured references in formulas
Nest the IF function
Use the VLOOKUP function
New Perspectives on Microsoft Excel 2013
2
Objectives
XP
• Review the HLOOKUP function
• Use the IFERROR function
• Use conditional formatting to highlight
duplicate values
• Summarize data using the COUNTIF, SUMIF,
and AVERAGEIF functions
New Perspectives on Microsoft Excel 2013
3
Terminology
Ribbon The strip of buttons and icons above the work area
Tab A collection of functionally-related controls and menus
Active Cell Cell with the black outline; data is always entered there
Worksheet An individual spreadsheet with rows & columns or a chart
Workbook A file containing multiple worksheets
Marquee Marks the currently active cell or range
Office Button Provides access to options such as open, print, etc
Quick Access Toolbar Stores shortcuts to frequently used features
Status Bar Hosts specific shortcuts and information about a workbook
Zoom Controls magnification of the screen
Dialogue Launcher Launches the associated dialog box
Formula Bar Displays the contents of the currently active cell
Name Box Displays the name of the currently active cell
Split Tabs Allows viewing of distant parts of a worksheet at the same time
XP
Tips for an effective
set of data
o Always create a header row, and format the header row so it’s
easily set apart from the rest of the data
o Do not include any entirely blank rows or columns
o Do not merge cells within the list
o Be Consistent – OH or Ohio, not either one throughout
XP
Differences between versions:
PivotTables Maximum rows displayed in a PivotTable report is 1 million. Maximum
columns displayed in a PivotTable report is 16,000. Maximum number of unique items
within a single Pivot field is 1 million. Maximum number of fields visible in the Fields list is
16,000.
Sorting Levels increased from 3 to 64.
AutoFilter Drop-down list length changed from 1,000 items to 10,000 items.
Maximum formula length Increased from 1,000 to 8,000.
Formula nesting levels Increased from 7 to 64.
Arguments in a function Increased from 30 to 255.
Conditional formats per cell Increased from 3 to available memory.
Unique cell styles in a workbook Increased from 4,000 to 64,000.
Unique colors per workbook Increased from 56 to 4.3 billion.
Characters in a cell that can be displayed and printed Increased to 32,000.
XP
XP
Formatting
Zoom
Slider
Freeze
panes
Fix
width
Keyboard
friends: Ctrl,
Shift, Arrow
Handy
formulas
for text
Handy Keyboard Tricks
XP
Shift, CTRL, and the Arrow Keys want to be your
best friends
Pressing the shift key, and using arrows
to move across text, lets you highlight a
section of text – whether in Word, Exel,
Powerpoint, etc. Try it!
In excel, if you add the CTRL key to
shift, using the arrows, you can get to
the end of a row, column, or the whole
table
Handy Keyboard Tricks
Give the mouse a rest! Try these shortcuts:
Cut = CTRL x
Copy = CTRL c
Paste = CTRL v
Undo = CTRL z
Redo = CTRL y
Find = CTRL f
New (Workbook, Document,
Powerpoint) = CTRL n
XP
Handy Text Formulas
=PROPER() Converts first letters to capital letters
=UPPER() Converts text to all upper case
=LOWER() Converts text to all lower case
=TRIM() Removes all blank spaces from the left
of a character field and left-justifies the text
=CONCATENATE() combines values in two or
more cells
Text to Columns separates values from a single
cell into multiple cells
XP
XP
Formulas
for
numbers
Analysis
Sorting
and
Filtering
VLookup
Pivot
Tables
Analysis Formulas
=Count() Counts the number of cells in a range
that contain numbers
=CountA() Counts the number of cells in a range
that are not empty
=CountBlank() Counts the number of empty cells
in a range
=CountIf() Counts the number of cells within a
range that meet a given condition
=Rows() Gives the number of rows in a selected
range
XP
Analysis Formulas
=Sum() Counts the number of cells in a range
that contain numbers
=Average() Counts the number of cells in a range
that are not empty
=Min() Counts the number of empty cells
in a range
=Max() Counts the number of cells within a
range that meet a given condition
XP
Printing
XP
• Note the Status Bar: Not only does it give you
stats about the data (sum, count, average,
etc.), but it’s where you can find quick page
view options:
– Normal – just shows all the cells
– Page Layout shows the margins, or how it will look
when printed
– Page Break Preview - find it annoying when you
can seem to fit things on a page? This viewing
option allows you to move the page break lines
Visual Overview
New Perspectives on Microsoft Excel 2013
XP
15
Logical Functions
New Perspectives on Microsoft Excel 2013
XP
16
Working with Logical Functions
XP
• Logical functions (IF, AND, and OR) determine
whether a condition is true or false
• Conditions use a comparison operator
(<, <=, =, <>, >, or >=) to compare two values
• Combine two or more functions in one
formula to create more complex conditions
New Perspectives on Microsoft Excel 2013
17
Inserting Calculated Columns in an
Excel Table
XP
• Entering a formula in one cell of a column
automatically copies the formula to all cells in that
column
• To modify the formula in a calculated column:
– Edit the formula in any cell in the column
– Formulas in all cells in the column are modified
• To edit only one cell in a calculated column:
– Enter a value or a formula that is different from all
others in that column
New Perspectives on Microsoft Excel 2013
18
Creating Excel Table Fields
XP
• Create fields that require the least
maintenance
• Store smallest unit of data possible in a field
• Apply a text format to fields with numerical
text data
New Perspectives on Microsoft Excel 2013
19
Using the IF Function
XP
• A logical function that evaluates a single
condition and results in only one value
• Returns one value if the condition is true and
another value if the condition is false
• Syntax:
New Perspectives on Microsoft Excel 2013
20
Using the IF Function
New Perspectives on Microsoft Excel 2013
XP
21
Using the IF Function
New Perspectives on Microsoft Excel 2013
XP
22
Using the AND Function
XP
• A logical function that tests two or more
conditions (up to 255) and determines
whether all conditions are true
• Returns the value TRUE if all logical conditions
are true and the value FALSE if any or all
logical conditions are false
• Syntax:
New Perspectives on Microsoft Excel 2013
23
Using the AND Function
New Perspectives on Microsoft Excel 2013
XP
24
Using the AND Function
New Perspectives on Microsoft Excel 2013
XP
25
Using the AND Function
New Perspectives on Microsoft Excel 2013
XP
26
Using the OR Function
XP
• A logical function that returns a TRUE value if
any of the logical conditions (up to 255) are
true and a FALSE value if all the logical
conditions are false
• Syntax:
New Perspectives on Microsoft Excel 2013
27
Using the OR Function
New Perspectives on Microsoft Excel 2013
XP
28
Using Structured References to CreateXP
Formulas in Excel Tables
• Replace specific cell or range address with the
actual table name or column header
– Names or headers are simpler to identify
than cell addresses
• A formula that includes a structured reference
can be fully qualified or unqualified
New Perspectives on Microsoft Excel 2013
29
Using Structured References to CreateXP
Formulas in Excel Tables
New Perspectives on Microsoft Excel 2013
30
Visual Overview
New Perspectives on Microsoft Excel 2013
XP
31
Nested IFs and Lookup Tables
New Perspectives on Microsoft Excel 2013
XP
32
Creating Nested IFs
XP
• To allow for three or more outcomes
• One IF function is placed inside another IF
function to test an additional condition
• More than one IF function can be nested
New Perspectives on Microsoft Excel 2013
33
Creating Nested IFs
New Perspectives on Microsoft Excel 2013
XP
34
Creating Nested IFs
New Perspectives on Microsoft Excel 2013
XP
35
XP
Using Lookup Tables and Functions
• Lookup functions
– Allow you to use tables of data to “look up”
values and insert them in another
worksheet location
• Lookup tables
– Store data and organize it into categories
(compare values)
– Can be constructed as either exact match or
approximate match lookups
New Perspectives on Microsoft Excel 2013
36
XP
Using Lookup Tables and Functions
• Lookup values (value you are trying to find)
– Need to match one of the compare values
– Can be used as part of a formula
New Perspectives on Microsoft Excel 2013
37
Using the VLookup Function to Find
an Exact Match
XP
• Searches a lookup table and, based on what
you entered, retrieves the appropriate value
from that table
• Searches vertically down the first column of
the lookup table
• Syntax:
New Perspectives on Microsoft Excel 2013
38
Using the VLookup Function to Find
an Exact Match
New Perspectives on Microsoft Excel 2013
XP
39
Using the VLOOKUP Function to Find XP
an Approximate Match
• Returns a value based on an approximate
match lookup
• Searches the first column of the table until it
locates the largest value that is less than the
lookup value
• Then moves across the row in the table to
retrieve the corresponding value
New Perspectives on Microsoft Excel 2013
40
Using the VLOOKUP Function to Find XP
an Approximate Match
New Perspectives on Microsoft Excel 2013
41
Looking Up Values Using the
HLOOKUP Function
XP
• Searches horizontally across top row of
lookup table and retrieves the value in the
column you specify
• Use when comparison values are located in
the first row of the lookup table and you want
to look down a specified number of rows to
find the data to enter in another cell
• Syntax:
New Perspectives on Microsoft Excel 2013
42
Looking Up Values Using the
HLOOKUP Function
XP
• Major difference between HLOOKUP and
VLOOKUP functions is the way lookup tables
are organized
New Perspectives on Microsoft Excel 2013
43
Using the IFERROR Function
XP
• Error value
– Indicates that an element in a formula or a
cell referenced in a formula is preventing
Excel from returning a calculated value
– Begins with a number sign (#) followed by
an error name that indicates the type of
error
New Perspectives on Microsoft Excel 2013
44
Excel Error Values
XP
• Excel error values are not particularly
descriptive or helpful
New Perspectives on Microsoft Excel 2013
45
Using the IFERROR Function
XP
• Displays a more descriptive message that
helps users fix the problem
• Can determine if a cell contains an error value
and then display the message you choose
rather than the default error value
• Enables you to easily find and handle formula
errors
• Syntax:
New Perspectives on Microsoft Excel 2013
46
Using the IFERROR Function
New Perspectives on Microsoft Excel 2013
XP
47
Visual Overview
New Perspectives on Microsoft Excel 2013
XP
48
Conditional Formatting
New Perspectives on Microsoft Excel 2013
XP
49
Conditional Formatting
XP
• Changes a cell’s formatting when its contents match
a specified condition
• Can be used to:
– Highlight cells based on their values
– Add data bars that graph relative values in a range
– Highlight duplicate values in a column of data
New Perspectives on Microsoft Excel 2013
50
Using the Conditional Formatting
Rules Manager
XP
• A conditional formatting rule specifies:
– Type of condition
– Type of formatting when that condition
occurs
– Cell or range the formatting is applied to
• Use Conditional Formatting Rules Manager
dialog box to edit existing conditional
formatting rules
New Perspectives on Microsoft Excel 2013
51
Using the Conditional Formatting
Rules Manager
New Perspectives on Microsoft Excel 2013
XP
52
Using the Conditional Formatting
Rules Manager
New Perspectives on Microsoft Excel 2013
XP
53
Using the Conditional Formatting
Rules Manager
New Perspectives on Microsoft Excel 2013
XP
54
Summarizing Data Conditionally
XP
• Use COUNTIF, SUMIF, and AVERAGEIF
functions to calculate a conditional count,
sum, or average using only cells that meet a
particular condition
New Perspectives on Microsoft Excel 2013
55
Using the COUNTIF Function
XP
• Calculates the number of cells in a range that
match specified criteria
• Sometimes referred to as a conditional count
• Syntax:
New Perspectives on Microsoft Excel 2013
56
Using the COUNTIF Function
New Perspectives on Microsoft Excel 2013
XP
57
Using the SUMIF Function
XP
• Adds values in a range that meet your criteria
• Also called a conditional sum
• Syntax:
New Perspectives on Microsoft Excel 2013
58
Using the AVERAGEIF Function
XP
• Similar to SUMIF function
• Calculates the average of values in a range
that meet criteria you specify
• Syntax:
New Perspectives on Microsoft Excel 2013
59
Using the AVERAGEIF Function
New Perspectives on Microsoft Excel 2013
XP
60
Download