Upload
aisha
View
159
Download
0
Tags:
Embed Size (px)
DESCRIPTION
INTERMEDIATE EXCEL 2010. Nolan Tomboulian. Tomboulian@ yahoo.com. Tomboulian.wikispaces.com. INTERMEDIATE EXCEL 2010. The class titles of Introduction, Intermediate and Advanced are relative to each user. - PowerPoint PPT Presentation
Citation preview
2
INTERMEDIATEEXCEL 2010
Nolan [email protected]
Tomboulian.wikispaces.com252-675-0176
The class titles of Introduction, Intermediate and Advanced are relative to each user.
This class will address some of the more common Excel features that go beyond basic navigation, data entry formula creation and
formatting. This class can only expose you to what EXCEL can do. The short class time does not allow for in-depth presentation and analysis of
the many features and powers of Excel.
3
This class is for users who have some experience using and creating Excel workbooks, understand cell and worksheet formatting, worksheet navigation, basic mathematical operands (+, -, *, /, ^), relative and absolute cells, Move/Cut/Copy/Paste, AutoFill and Functions.
EXCEL Intermediate Course Objectives
•Quick Skill Review of:•[File] Tab and Back Stage View•Ribbon / Tabs / Groups / Commands / Dialogs boxes•Quick Access and Ribbon Customization•Workbook navigation and keyboard commands, Keyboard Tips•Cell and Data Formatting •Copy / Paste / Paste Special Options •AutoFill Options•Selecting Ranges •Relative and Absolute cell reference•AutoSum and basic Functions
4
EXCEL Intermediate Course Objectives •Data & Tables:
•Filtering / Sorting / and Custom Sort Lists
•Data Validation
•Conditional Formatting
•Data Lookups: VLookUp, HLookUp, Match and Index Functions
•Sub-Totals and Groupings
•Logical functions (IF, AND, OR, NOT)
•Conditional Data Summaries (COUNTIF, SUMIF, AVERAGEIF, COUNTA)
•Intermediate Formulas and Functions (Round, INT, RANK)
•Introduction and creation of simple Pivot Tables
•Intermediate charts and graphics
•Using other Functions
•Other Topics?
Table Of Contents
5
Page Topic
9 House Keeping
17 Review
29 Tables
53 Sorting and Filtering
73 Data Validation
81 Conditional Formatting
93 Subtotals and Groups
105 IF, Logic (And, Or, Not)
129 Lookup Functions
141 Summary IF
153 Pivot Tables
Blank for Duplex Printing
6
Blank for Duplex Printing
7
Blank for Duplex Printing
8
HOUSEKEEPING
RULESINTRODUCTIONSLOGISTICSAGENDAFILE INFORMATIONCONTACT INFORMATION
Logistics
• Parking• Bathrooms• Student Facilities• Smoking• Fire Alarm / Code Red• Breaks and Lunch
10
This class will not be…
LengthyEndless ContinuousTorture withUnendingRepetition of Explanations.
11
A LECTURE
Class participation is welcomed and beneficial to you (and others)
Not too many people know that the word “LECTURE”is actually an acronym. It stands for
Code Of Conduct• Respect each other (Talking)• Food and Drink• Participate• Patience (with me and yourself)• Ask questions• Have FUN• Have your own projects or ideas?• Turn in the Evaluation Survey!
Class Flow
• General Flow– Overview of Topic– Step-by-Step Exercises– Independent Practice
• Questions• Collaboration
13
Technical Issues
• Many of the files should be in a READ ONLY mode to keep you from changing them.
• Create a File Folder on the T: drive, Desktop or flash drive where you plan to save your work.
• Do a SAVE AS to add files to YOUR File Folder.• The SAVE AS does not remove the Read Only status.
– Press the Office Button and then Prepare – Mark as Final
14
The Exercise Data Files could be:1) On your Desktop 2) On the T: Drive
ExcelWorkbooks
This Page Blank for Duplex Printing
17
http://office.microsoft.com/en-us/excel-help/excel-shortcut-and-function-keys-HP010073848.aspx
Keyboard Shortcuts[Alt] for Keyboard Tip Codes
<Right Click> for Option Dialogs
ALT Menu KeyTips Ctrl <F1> compress Ribbon<F1> Help<F2> Edit<F3> Name Manger Ctrl <1> Format Cells Dialog<F4> Absolute Cell Reference <F7> Spell Check<F5> Go ToCtrl Z Undo Ctrl <Y> RedoShift <space> Select Row Ctrl <space> Select a ColumnCtrl <T> Activate as Table Ctrl <A> Select Range<F9> Recalculate Ctrl ~ Show formulasCtrl <0> Hide Column
18
Copy / Paste / Paste SpecialWork Smart – Not HardKeyboard:
Ctrl C = CopyCtrl X = CutCtrl V = Paste
<Right Click>CopyPastePaste Special
20072010
Not a Formula
19
Paste Special
http://www.dummies.com/how-to/content/using-paste-special-in-excel-2007.html
The Clipboard can hold 20 items that have been cut and can be reused.
20
Copy with AUTOFILLExcel is pretty smart in that it can interpret “patterns of data” and copy / fill the information to other cells.
Select the cell or range that contains the formula, formulas or data to copy.
<Left Click> and Drag the fill handle in the direction you want to copy the data or formula(s) and then release the mouse button.
To copy only the formats or only the formulas, click the AutoFill Options button (that appears after dragging the fill handle) and select the appropriate option.
Shortcut: Double Left Click on Fill Handle if there is data in the column to the Left!
21
To copy only the formats, formulas, or data, left click the AutoFill Options button (that appears after dragging the fill handle) and select the appropriate option.
AUTOFILL
22
Cell Formatting<Right Click> in a Cell and select Format Cells,
or use the Ribbon [HOME] tabOr use <Ctrl> <F1>
23
Number Cell Formatting<Right Click> in a Cell and select Format Cells or use the Ribbon [HOME] tab
24
Alignment Cell Formatting<Right Click> in a cell and select Format Cells or use the Ribbon [HOME] tab
25
Font Cell Formatting<Right Click> in a Cell and select Format Cells or use the Ribbon [HOME] tab
26
Border Cell Formatting<Right Click> in a cell and select Format Cells or use the Ribbon [HOME] tab
27
Fill Cell Formatting<Right Click> in a cell and select Format Cells or use the Ribbon [HOME] tab
28
Protect Cell Formatting<Right Click> in a cell and select Format Cells or use the Ribbon [HOME] tab
TABLES AND
DATA RANGESNolan Tomboulian
s.com
TABLE Objectives• Create / Define / Name tables• Explore the Ribbon Table Tab • Add and delete records (Rows) and Fields (Columns)• Add Formulas and change column formatting• Sort data
– Single Key Multi Key Custom Sort• Filter data
• Use the Styles options
• Use the Total Row to summarize a table
• Use the Outline buttons to show or hide details
30
SubTotal is a special group function that can be done on a Range of data using the [DATA] tab, BUT CANNOT BE USED ON A TABLE!
Structured Range of Data• One of the more common uses of Excel is to
manage data – It is not just a calculation tool!• Using Excel, you can:
– Store and update data– Sort data– Filter or Search for and retrieve subsets of data– Summarize data– Create reports and graphs
31
Structured Range of Data
• In Excel, a collection of similar data can be structured in a range of rows and columns– Each column in the range represents a field– Each row in the range represents a record
• You Cannot change the Excel Column Headings (A,B, C…, but you can create (SINGLE ROW) Headings to be used with your table)
32
Creating Fields (columns)Keep in mind these best practices• Create fields that require the least
maintenance– Ex. Hire_Date vs Time_With_Company
• Don’t use <Spaces> in Descriptions• Store the smallest unit of data possible
– Ex. Store City, State, and Zip in separate fields• Apply a text format to fields with numerical
text data (esp. if there are leading zeros)– Ex. Zip Code, Social Security Number, Product code
33
Structured References• Structured References
– You can reference a specific cell or range in a table with a structured reference
– Uses the field names, as opposed to the cell reference
– Similar in functionality to a named cell or range• Easy to understand:
=SUM(G20:G123)=SUM(Employee[Annual_Salary])
34
Structured References
• To use a structured reference in a formula or function:– Type a left bracket - [
• to open the field list for the table– Double-click the field name– Type a right bracket ]
35
Structured References• Structured References can also use special
qualifiers to refer to special portions of the table, such as the Total Row.
36
Structured Range of Data
37Museum
Tables
• Range of related data, managed separate from other data on a worksheet
• Easy access to data management and analysis tools
• Can have multiple Tables in a worksheet
38
Table Features• Table Formats and Styles (Depending on selected options, you have
different STYLES for Row and Column highlighting)• Adding or inserting new rows or columns automatically expands the
Table Range.• Easily add a Total Row to calculate summary statistics (Sum, Count,
Average, etc)• Formulas applied in one cell will automatically be applied to all cells in
that field (column) – no need to highlight or Copy Down!• Formatting can be applied to an entire column• Can use the table and field names as a cell reference in a formula. –(It
looks complex when you see the formula – but when using – Point-and-Click it is more clear.)– For Example to add a formula to increase the Appraised Value by
10%: =DATA[[#This Row],[Appraised Value]]*0.1
39
Creating an Excel Table• Highlight / Select the range of data to be included in the table.
– Tables don’t need “Column Headings” but the features are more useful when they are defined.
– <Ctrl A> is a shortcut to select a range of data– <Ctrl> <T> selects the data and makes it a Table
• Go to the Insert tab – Tables group• Click the Table button
– Ctrl-T is a shortcut to create a new table• Verify the RANGE is correct and Check if the table has column headings.
40
Excel will:Create a context Ribbon [Table Design] Tab Add Filter dialog commands to fields (Column Headings)
Enter a Table Name to reference the table (Optional)
Creating an Excel Table
41
42
Using a Structured Table
If you <click> outside the table, the <Table Tools> goes way.Click ANYWHERE on the Table to reactive the [Table Tools]
and then <Click> the {Design Tab}You may NAME the table so you can use the Table Name as a reference in formulas rather than Absolute Cell Addresses:
Inserting a column or row into the table will EXTEND the Table Name Range
Adding an Adjacent Column or Row will also EXTEND the Table Name Range.
(Use Resize if adding nonadjacent columns)
43
The Ribbon <Table Design> Tab GROUPS
Define or Rename a Table range
Extend the size of a Table if Nonadjacent columns or rows were added
Pivot Tables are another Topic
Be Careful with REMOVE Duplicates – It actually deletes rows from the Table.
• Convert to Range: Un-define the Table: Cell Styles will still be applied!- You must <CLEAR> Formatting.
• May also cause problems with Defined Formulas
44
The Ribbon <Table Design> Tab GROUPS
External Table Data is an Advanced function
Banded Rows and Columns allow for different Color Styles to be applied.
Header Row – Turns on and off the Titles.
First and Last Column allow the “MEDIUM” style formatting .
Total Row is a fast way to get some Summary Statistics about the table.
Using the Total Row
• A Total Row, which you can display at the end of the table, is used to calculate summary statistics for the columns in an Excel table.
• Total rows can be set to display different summary statistics for each field.
• Total rows usually automatically recalculate as records are added and deleted.
45
Using the Total Row
• Go to the [Table Tools Design] tab –{Table Style} Options group
• Click the Total Row check box to insert a check mark
• Scroll to the end of the table• Set the desired summary function
46
Navigation in a Worksheet - REVIEW
• <Tab> Move to the right• <Shift> <Tab> Move to the left• <Enter> Move <DOWN> a row• <shift> <Enter> Move <UP> a row• <Home> Move to the start of the Row• <Shift><Home> Select from the Cell to the A Column• <Ctrl> <Home> Move to the top of the WORKSHEET• <End> <Down Arrow> Move to the last Row• <End> <Up Arrow> Move to the top Row• <Ctrl> <Left Arrow> Move to first column• <Ctrl> <Right Arrow> Move to last column• <Up>, <Down>, <Left>, <Right> arrow
47
Finding and Editing Records
• Go to the [Home] tab – {Editing group}, click the Find & Select button, and then click Find
• Type your search criteria in the Find what box, and then click the Find & Select button
• You could also use Table <FILTER> to select certain record items
48
Exercise – Table Creation• Create a Table• Renaming a Table• Formatting a Table
– STYLES– Column Formats
• Adding a Column• Adding and Deleting records (Rows)• Adding a TOTAL ROW
49
Page Left Blank For Duplex Printing
Page Left Blank For Duplex Printing
Page Left Blank For Duplex Printing
53
SORTING AND
FILTERING
Sorting and Filtering• Allows data to be viewed differently from how it was
entered• Key functionality of Excel when used to manage data• Sort rearranges the data in a table or range, based
on the sort criteria– (Any SUBTOTALS applied will be reset with a SORT
• Filters present the data that meets the filter criteria (original data structure remains intact.)
• Filters can be applied to multiple columns (Fields)• When using Filters, care must be taken that you are
reporting the data you really want to show!54
Sorting Data• You can rearrange, or sort, the records
in a table or range based on the data in one or more fields – (Old Limit was 3 levels of sorting)
• The fields you use to order the data are called sort fields
• You can sort data in ascending (A-Z) or descending (Z-A) order, unless using a custom list
55
Sorting Single Columns
• Click any cell in the column you want to sort by– (You used to have to highlight the range of data you
wanted to sort – otherwise it would only sort that column!)
• Go to the [Data] tab Sort & Filter group or on the {HOME TAB]
• Click the desired sorting button• (Sort A to Z or Sort Z to A)
56
Sorting Multiple Columns• Click any cell in a Table or Range• Go to the [Data] tab - Sort & Filter
group Click the Multi Sort to open the Sort dialog box
• Or [HOME] Tab {Sort} Custom
57
Sorting Multiple Columns
• Set the primary sort criteria– Click the Sort by arrow and select the column heading that
you want to specify as the primary sort field– Click the Sort On arrow to select the type of data– Click the Order arrow to select the sort order
58
To sort by additional columns• Click the Add Level button • (additional levels are indicated by the words
“Then By”)• Click the Sort by arrow and select the column heading
that you want to specify as the secondary sort field• Click the Sort On arrow to select the type of data• Click the Order arrow to select the sort order• Repeat for addition Levels of Sort.
It is Best if your Data has Column Headings
Sorting Using a Custom List
• A custom list allows you to indicate the sequence in which you want data ordered.
• Used when you want to sort text data outside of the normal Ascending and Descending sequence
• Can use predefined custom lists or define your own.– Months: Jan, Feb, Mar, April, May, June….– Days: Sun, Mon, Tues, Wed, … – Region: North, West, South, East, South West– Condition: Poor, Fair, Good, Excellent
59
Sorting Using a Custom List• Go to the [Data] tab - Sort & Filter group • Click the Custom Sort button• When selecting the ORDER,
– Click the Order arrow, • and then click Custom List
• In the List entries box, type each entry for the custom list, pressing the Enter key after each entry
• Click the Add button• Click the OK button
60
Exercise For Sorting
• Sorting by One Column• Sorting Data using Multiple Columns• Sorting by creating a Custom List
61
62
FILTERINGIf the data range is not defined as a Table and the column headings do not have the FILTER option, the FILTER Option can be turned on from the [HOME] tab using the dialog box
This option is also used to CLEAR all applied filters
<Ctrl> <T> will activate a range of Data as a Table
Filtering
• Excel automatically creates filters when a TABLE is created.
• Clicking the filter dialog arrow in a column opens the Filter for that field.
• Data can be filtered by:– Cell or font colors– Apply Text or Numeric Filters and conditional logic– Select specific values
63
Filtering (Example using “Criteria”)
64
Filtering Using Multiple Columns• If you need to further restrict the records that appear in
a filtered table, you can filter by additional columns• Each additional filter is applied to the currently filtered
data and further reduces the records that are displayed.• The Column Heading drop down option indicates if a
column has been used to Filter or Sort the data.
65
66
Creating Criteria Filters
• Criteria Filters enable you to specify various more complex conditions in addition to those that are based on an “equals” criterion.
• Different data types have different criteria that can be used in a filter.
Criteria Filters and Selection Filters are mutually exclusive. You cannot mix them!
Creating Criteria Filters
67
Creating Criteria Filters
• Click on the Filter arrow of the field (column) you want to filter by.
• Select the filter type (usually right above the unique values list). The data type of the field will determine the type of filter available.
• Select the filter operator• If necessary, provide criteria values
68
Exercise Filters
• Filtering by One Column• Filtering Data using Multiple Columns• Clearing Filters• Selecting Multiple Filter Items in One Column• Create a NUMBER Criteria Filter• Create a TEXT Criteria Filter
69
SLICERS
Slicers are GUI (Graphical User Interfaces) to control Filters being used.
You must have a DATA Range or Table Defined
[INSERT] Tab Slicers
Blank Pages for Duplex Printing
Blank Pages for Duplex Printing
DATA VALIDATION
G. I. G. O.Garbage In – Garbage Out
Checking values at the time of Data Entry Or
Apply validation rules before processing a workbook you have been given from someone else!
Data Validation
74
When designing a workbook, a good design should consider who is entering the data and how important is it that the data being entered conforms to certain established rules.
SEX might be defined to only allow for “M” or “F” (it is case specific!)RACE might be limited to “B”, “W”, “H”, “A”, “O”Zip-Code might be defined to be a 5 digit number (US standard)Department might be limited by a select LIST of values
(Accounting, HR, Production, Audit)Numeric Data might be defined to only be “Whole Numbers” or to be
within a certain range or be bounded by limitsState or Name may be limited to a certain number of charactersCheck input for a valid date or date range values
What is the impact and cost associated with having invalid data?
For Example:
DATA VALIDATION
75
Data Validation is used to “trap” errors at the time of Data Entry.The =IF and other Logic Functions can also be used to find “errors”
Select the Range of data for the Data Validation Rule
RIBBON [Data] tab
Data ValidationThere are three tabs.1) Data Validation for NEW rules2) Circle Errors to identify errors that were entered BEFORE the validation rule was applied.3) Clear Circles to remove the indication of data validation exceptions.
Conditional Formatting could also be applied to provide a visual for incorrect data
Data Validation• There are 3 tabs to a Data Validation Dialog:• {Settings} {Input Message} {Error Alert}
76
1) Allow a) What kind of data do you want to check?b) What do you want to do with “Blank” data?c) Do you want the data entry to be via the keyboard or from a “Selection Box”
2) Input Message I suggest leaving this blank since it will “repeat” for every cell. You could define two rules, 1 for the 1st cell with a PROMPT and then another rule for the additional cells.
3) Error Processinga) STOPb) Warningc) Informational
Data Validation• Too CLEAR (ERASE)
the Data Validation from a Range,
• You need to• Selet the Range• [Data] Data
Validation• And press the
[Clear All] Button
77
EXERCISE APPLY DATA VALIDATION RULES
78
Page Left Blank for Duplex Printing
CONDITIONAL FORMATTING
Create special color coded, mini bar graphs and/or icon “views” of data
based on various criteria and “Rules”
Conditional Formatting• Why use conditional formatting?
– Emphasize data– Call attention to errors– Easy data correlation
• Can use built-in Conditional Formatting Rules, or create your own
• Can “Filter” data based on Cell Format Color• Built in rules can usually be modified:
– (ie: Top 10 can be any number: Top 2, Lowest 3, Top 15%)• Can reference a cell, use a “Constant” value, or even a
formula: $A$17 70 =$A5>$B5
82
[HOME] Conditional Formatting
83
84
Conditional Formatting
Data Bars and Icons You can “hide” or “display” the Data Value with the graphic. Be careful with the use of colors for color blindness and printing. While there may be 3 to 5 Icons, you can define the rules
Icon Sets100
7460559045807522
Data Bars & Icons
Custom Conditional Formats• You can have multiple conditions that apply to the same range of
data.• Each time you create a custom conditional format, you are
defining a Conditional Formatting Rule.• A Rule specifies the type of condition (such as formatting cells
greater than a specified value) and the type of formatting to apply when that condition occurs.
• When you have multiple rules, you should test your conditions to make sure the logic is applied in the correct or desired sequence.
• Be careful with colors, because some people don’t see them! It also takes more ink when printing!
• Negative Numbers do not work in 2007 (fixed in 2010 )
85
ExerciseRemoving Duplicate Records
• Highlight the Range of Date• Select [Home] Data Validation• Select {Highlight Cell Rules}• Select “Duplicate” records• Create/Edit Conditional Formatting Rules• Highlight an entire ROW of data based on a Formula
86
87
Average Analysis using worksheet: AVG-Analysis
Name ID Test-1 Test-2 Test-3 Test-4 Average
Ann 784 88 87 90 88Bill 346 56 88 78 72 74Carol 267 65 43 66 60 59David 874 64 40 70 0 44Ed 323 90 92 87 80 87Fran 784 92 89 0 81 66Gail 201 47 35 55 57 49Hank 102 50 65 85 95 74Iris 503 87 92 90 80 87Jane 983 89 95 87 75 87AVERAGE 72.8 72.6 68.66667 69 71Max 92 95 90 95 88Min 47 35 0 0 44
Range 45 60 90 95 45
88
Using Conditional Formatting – ExampleThis example is a more complex use of the Conditional Formatting Option to highlight an entire ROW of data based on a condition.The worksheet is: Student_Data .
Name Sex Race Age Score
Ann F W 19 90
Bill M B 21 78
Candy F B 18 85
Davd M B 20 98
Eva F W 17 86
Frank M H 19 62
Gina F H 21 90
Hilda F W 19 85
Irene F H 20 66
Jack M B 19 45
Kellie F H 22 88
Lisa F H 36 96
Mark M B 42 85
Nick M B 36 80
Oliver M H 22 85
Peter M W 18 75
Quincy M H 20 95
Richard M B 18 80
Sandra F W 22 70
Highlight the Data Range (A2:E20)[Home]{Conditional Formatting}Manage Rules
New Rule Use a Formula to determine which cells to format
http://www.free-training-tutorial.com/animations/conditional-formatting-row.html
Enter the Formula:Example Format: =$ColumnRow =valueString data values need to be in “Quotes”
Use conditions: =, >, <, >=, <=, <>Example:
= $C2=“W”=$D2>25
(You need to use the ABSOLUTE Column Cell Reference)
Select the FORMAT for the Rule.Verify the APPLIES TO: range
$A$2:$E$20
Conditional Formatting
89
Use the {Find and Select
} option on the [HOME} tab to
identify Cells and Ranges that may
contain Conditional Formatting
Page Left Blank for Duplex Printing
Page Left Blank For Duplex Printing
Calculating Subtotals • Subtotals are used to summarize a range of data
• Subtotals cannot be applied to an Excel Table
• If the data being analyzed is in a Table, it must be removed. [Design] {Convert to Range}
• The data must be sorted so it is grouped as desired BEFORE applying subtotals in order to do “Control Breaks” in the correct order:
• City / Sex / Race Location / Criteria / Artist• Race / Grade / Sex Artist / Location / Criteria• Sex / Grade / Age
94
Calculating Subtotals
• Sort the data by the column(s) for which you want a subtotal
• If the data is in an Excel table, go to the – [Table Tools Design] tab - Tools group, and click the
Convert to Range button• Go to the [Data] tab - Outline group, and click the
Subtotal button• Click the At each change in arrow, and then click the
column that contains the group you want to subtotal
95
96
Calculating Subtotals
• Click the Use function arrow, and then click the summary function you want to use.
• In the Add subtotal to box, click the check box for each column that contains the values you want to summarize.
• To calculate another category of subtotals, click the Replace current subtotals check box to remove the check mark, and then repeat the previous three steps.
• Click the OK button
Calculating Subtotals
97
Using the Subtotal Outline View
• The Subtotal feature also applies an outline to the data so you can control the level of detail displayed.
• The three Outline buttons at the top of the outline area (left side of the worksheet area) allow you to show or hide different levels of detail in the worksheet.– Level 3 – displays the most detail– Level 2 – displays the subtotal rows and grand total– Level 1 – displays only the grand total
98
Using the Subtotal Outline View
99
Using Subtotal for Student Grades
100
Name Grade Sex Race Math English Science AvgBill 7M W 86 92 75Amy 7F W 92 81 88Sandy 7F B 97 92 87Carol 8F B 72 75 82David 8M B 96 88 91
This is a subset select of Student Data you have been asked to summarize.
You have been asked to Count and average subject scores and Total Average by Grade, Sex and Race
This Page Left Blank for Duplex Printing
This Page Left Blank for Duplex Printing
This Page Left Blank for Duplex Printing
Objectives• Using IF to evaluate a single condition• Using the AND function for multiple conditions• Using the OR function for multiple conditions• Using the NOT function to take the inverse result
of functions (AND / OR)• When Nested IF Functions are needed to
calculate 3 or more different outcomes:
–Consider using a Lookup Table if the number of conditions to be tested is large. 106
Logical Functions (And / Or / Not)
• These functions are not computational: – They return a “True” or “False” value based on
the conditional test.• They are used to test for conditions to be used
for further analysis.• When combined with other functions, they
can be used to perform actions on data, based on returned value of the logical function.
• They can be used in a Cell or nested within an =IF function.
107
108
Working with the Logical
=IF Function
• The IF function is a logical function that returns a TRUE value if the logical condition is true and a FALSE value if the logical conditions are false.
• The TRUE and FALSE values can be flags that can be used in additional formulas, actual values or operations, or even other formulas
IF Function syntax:IF(logical_test, Do_if_true, [Do_if_false])
IF Function
109
A B C D E
1 Name Salary Add-Life Premium
2 Bill $72,000 Y =IF(C2=“Y”,B2*.07,0)
3 Sarah $100,000 N =IF(C3=“Y”,B3*.07,0)
4 David $64,000 N =IF(C4=“Y”,C3*.07,0)
String values must be in Quotes
It IS NOT case sensitive.
110
A B C D
1
2 Jets 12
3 =IF(B2>B4,A2,A4)
4 Panthers 18
Game Bracket
A B C D5
6 Giants 9
7
8 Saints 6=IF(B6>B8,A6,A8)
Copy A2:C4 and paste into A6 to create a 2nd bracket of Games
111
A B C D E F G
1
2 Jets 12
3 =IF(B2>B4,A2,A4) 6
4 Panthers 18
5 =IF(
6 Giants 9
7 5
8 Saints 6
Game Bracket – Round 2
=IF(B6>B8,A6,A8)
Add values in D3 and D7 and create a formula in E5 to show the winner
=IF(D3>D7,C3,C7)Can you copy the cells from A2:E8 into A10, and add the logic for ROUND 3?
Now copy the cells for the 8 teams and add the logic for ROUND 4
You now have the template for a 16 team Regional Tournament
112
A B C D E
1
2 Jets 18
3
4 Panthers 18
Nested If
This example demonstrates a Nested IF. While in “real life” we assume there is only one “winner”
and “Loser” what if we allowed for the possibility of a TIE.
What happens now if a TIE score is entered in B2 and B4? WHY?
=IF(B2=B4,”TIE”,IF(B2>B4,A2,A4))
=IF(B2=B4,”TIE”,IF(B2>B4,A2,A4))
Working with =AND Function
• The AND function is a logical function that returns a TRUE value if all of the logical conditions are true and a FALSE value if any of the logical conditions are false.
• Can test up to 255 logical conditions• =AND(cond1, Cond2, Cond3….)
113
Cond1 Cond2 ANDTrue True True
True False False
False True False
False False False
AND Function
114
A B C D E F
1 Name Salary Status Years Flag 401K
2 Bill 100 FT 4
3 Ann 70 FT 1
4 Carol 60 PT 6
5 Ed 30 ZZ 10
6 Dave 150 FT 0
7 Sue 50 PT 1
In E2: =AND(C2=“FT”,D2>=1)
In F2: =IF(E2,B2*.03,0)
Working with Logical Functions
115NESTED IF
Working with Logical Functions
• A nested IF function is when one IF function is placed inside another IF function to test for multiple outcomes
• Can allow for three or more outcomes, instead of just two=IF([Pay Grade]=1,2500,IF([Pay Grade]=2,5000, IF([Pay Grade]=3, 7500,"Invalid pay grade")))
116
Working with Logical Functions=OR
• The OR function is a logical function that returns– TRUE value if any of the logical conditions are true – FALSE value if all the logical conditions are false
• =OR(logical_test_1, logical_test_2,…)
117
Cond1 Cond2 OR
True True True
True False True
False True True
False False False
Literary Trivia:Shakespeare was
working on an Excel spreadsheet and created a formula
that inspired one of his most famous
lines.
118
Literary trivia: Shakespeare was working on an Excel spreadsheet and created a formula that inspired one of his most famous lines.
=OR(B2, Not(B2))This will always be “TRUE” Statement
Working with Logical Functions=NOT
• Takes the Opposite of a returned condition• =NOT(logical_test)
119
Cond1 NOT
True False
False True
Working with Logical Functions
• =IF(OR([Years Service]<=1,[Annual Salary]>100000),0, IF([Pay Grade]=1,$T$1,IF([Pay Grade]=2,$T$2, IF([Pay Grade]=3,$T$3,"Invalid pay grade"))))
120
If Years is Less than or equal to 1 or Salary > 100,000, there is no BonusOtherwise, check the Pay Grade code to assign a constant value
Checking Formulas
• Check your parentheses• All functions have an opening and closing
parentheses– Correct number– Correct position
• Excel uses color coding to help you keep track of items in a formula
• Don’t use the “=“ inside of Nested functions.
121
122
Example Electoral College
Every four years, the United States has an election to pick the President. A system is used to assign “VOTES” based on the population of the State. And the number of representatives the state has. It is a “Winner Take All” – Whoever wins a majority of the votes in the state gets ALL the Electoral Votes
This example uses an =IF function to assign the votes to a Republican 1=(RED) or Democrat 2=(BLUE)
Maybe a Data Validation should be assigned to the input Cells for the Data Entry in the E and H columns
There is also a condition in Column J to compare the Predicted Result with the Actual Result..
Exercise – Payroll Record
• Use the IF function to calculate Regular hours worked (<=40)
• Use the IF statement to calculate if there are any Over-Time Hours
• Use the If statement to calculate Overtime Rate If there was Overtime Hours.
123
Exercise Payroll Record Part2
• Use a Nested IF function to calculate Deductions based on a code.
• The code of 1 = 3%• The code of 2 = 6%• The Code of 3 = 8%
• You also need to code INVALID data entry codes.
124
Page Left Blank for Duplex Printing
Page Left Blank for Duplex Printing
Page Left Blank for Duplex Printing
Using the
VLOOKUPHLOOKUP
INDEX and MATCHFUNCTIONS
Use a value in a Cell as a Key to index a column in another table and return
an associated piece of data to be displayed or used in another
calculation.129
Lookup Tables and Functions
• A lookup table is a table that organizes data based on different categories, in order to retrieve a value from the data
• The category for the lookup table, called compare values or Key is located in the first column (VLookUp) or row (HLookUp) of the table.
• To retrieve a particular value from the lookup table, a lookup value (the value you are trying to find) needs to match one of the compare values
130
Lookup Table ExampleFortune Cookie Sentence Generator
131
TABLE LOOK-UP Example
Noun Verb Adverb Preposition3 6 5 5
Carol talked mindlessly to a friend
Carol talked mindlessly to a friendNoun Verb Adverb Preposition
1Bob 1ran 1quickly 1toward home2The Chicken 2walked 2carelessly 2to school3Carol 3skipped 3slowly 3from the library4Sue 4drove 4quietly 4behind the store5Alice 5jumped 5mindlessly 5to a friend
6talked
Lookup Tables and Functions
132
Lookup Table
133
The Actual values and cell locations used in the example are different than what is shown here.
Lookup Tables and Functions• Two types of lookup functions• VLOOKUP
– VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
• HLOOKUP– HLOOKUP(lookup_value, table_array, row_index_num, [range
lookup]• range_lookup: Optional - True or False.
– If Blank or TRUE, it looks for an Approximate Match • KEYS in table MUST BE IN ASCENDING SEQUENCE
– If the KEY is not found, it returns the value of the prior key– If FALSE, the KEY must be an Exact Match and the Keys DO NOT
need to be in order.134
Lookup Tables and Functions
• Lookup functions can be used to find exact matches and approximate matches
• Exact match looks for an exact match between the lookup value and a corresponding value in the lookup table
• Approximate match looks for a correlation between the lookup value and a range of values
135
Lookup Tables and Functions
• When using an approximate match lookup (TRUE), the compare value (Key) in a lookup table must be sorted by alphabetical order (if text) or low-to-high order (if numeric)
• Excel searches the first column (VLookUp) or row (HLookUp) of the lookup table (compare values) until it locates the largest value that is still less than the key.
136
Exercise VLookUp Payroll Record Part-3
• Use the VLOOKUP function to find an exact match for a code.
• VLookUp is better than a Nested If when you have many possible values.
• Management is so happy with the work you have done on the Payroll Record spreadsheet, they want to add a lookup to an Employee Information Data Table.
• In addition, since the Employee name is used in other processes, they want to use a table that uses the ID to extract the Employee Name, Department , Pay Rate, Deduction code and Health Insurance Amount. The Employee Table will also contain another lookup to a Health Insurance Code Value Table. 137
Page Left Blank for Duplex Printing
Page Left Blank for Duplex Printing
CONDITIONAL SUMMARY FUNCTIONS
141
CountIfSumIf
AverageIfAnother way to calculate summary information rather than using Subtotals or creating multiple =Count, =Sum or =Average functions on various ranges of data.Improvement over the old functions : Dcount, DSum and DAverage Functions
Summarizing Data Conditionally
• Tests for a condition (or multiple conditions) before applying a summarization function
• Calculates values based on the condition• Useful for summarizing a subset of data
determined by another piece of data• Calculate average salaries for employees in specific cities• Calculate Grades by Sex and Race• Count the data based on employees in a Department
142
Summarizing Data Conditionally
SUM_Range and AVERAGE_Range are the columns of data values to summarize.
(If left out, it uses the column defined in the RANGE. )
143
RANGE: Is the rows that are being compared to the CRITERIA
CRITERIA: This is a single Value or Cell that is being compared to the values in the RANGE
Summarizing Data Conditionally
SUMIF which is also called a conditional sum=SUMIF(range, criteria [,sum_range])
144
COUNTIF which is sometimes referred to as a conditional count
=COUNTIF(range, criteria)
AVERAGEIF to calculate the average of values in a range that meet criteria you specify
=AverageIF(range, criteria [,average_range])
Summarizing Data Conditionally
• COUNTIF, SUMIF, and AVERAGEIF only test for one condition!
• If multiple conditions are being tested to calculate a value, use:
145
COUNTIFsSUMIFs
AVERAGEIFs
146
Conditional IF – SUMMARY FUNCTIONSPayroll Record 5
Management continues to be impressed by your skills with Excel and they now want a summary report by Department of the data in the Payroll Record Worksheet
The CountIF formula has been done for you. You need to add the formulas for the other totals
Be careful with Relative and Absolute Cell ranges when creating/copying your formulas.
147
CONDTIONAL SUMMARYStudentGrades3_Conditional
The StudentGrades3onditional workbook has details for students by :
Grade, Sex and Race
Conditional IF formulas can be defined to look at more than one variable to decide how to add, count or average the data.
Some Formulas have been done to Count and find the Average Math and Average Average Score.
Add the formulas for the Average Science and Average English Scores.
The [Formulas] {Define Names} was used to define the columns of data that would be used for the selection criteria. This eliminates the need to use the Absolute Cell Reference to Define the Range of data and the “Name” of the range is easier to understand than cell addresses.
Use the [Formulas] {Name Manager} to see the defined named ranges
Summarizing Data Conditionally• The COUNTIFS function counts the number of cells within a
range that meet multiple criteria– COUNTIFS(criteria_range1, criteria1 [,criteria_range2,
criteria2...])• The SUMIFS function adds values in a range that meet multiple
criteria– SUMIFS(sum_range, criteria_range1, criteria1
[,criteria_range2, criteria2...])• The AVERAGEIFS function calculates the average of values
within a range of cells that meet multiple conditions– AVERAGEIFS(average_range, criteria_range1, criteria1
[,criteria_range2, criteria2...])
148
Notice the AVERAGE_Range and SUM_Range are at the beginning of the formula rather than at the end
This Page Left Blank For Duplex Printing
This Page Left Blank For Duplex Printing
This Page Left Blank For Duplex Printing
PIVOT TABLES (INTRODUCTION)
153
PIVOT TABLES are another way to calculate summary information rather than using:
Subtotals creating multiple ranges of data
and using =Count, =Sum or =Average
using the Conditional IF: CountIF, AverageIF or SumIF
functions.Pivot Tables get their name because you can define reports with fields of data and assign them to summarize as Rows or Columns.
Analyzing Data with PivotTables
• A PivotTable is an interactive table that enables you to group and summarize either a range of data or an Excel Table into a tabular format for easier reporting and analysis
154
Analyzing Data with PivotTables
• Value fields – fields that contain the data you want to summarize
• Category fields – group values in a PivotTable– Category fields can be row labels, column
headers, and report filters• Start by sketching out the PivotTable
– How will it be organized? Columns, Rows?– What values need to be summarized?
155
Creating a PivotTable
• Click in the Excel table or select the range of data for the PivotTable
• Go to the [Insert] tab - Tables group, and click the PivotTable button
• Click the Select a table or range option button and verify the reference in the Table/Range box
• Click the New Worksheet option button or click the Existing worksheet option button and specify a cell
156
Creating a PivotTable
• Click the OK button• Click the check boxes for the fields you want
to add to the PivotTable (or drag fields to the appropriate box in the layout section)
157
Creating a PivotTable
158
Exercise
• Create a PivotTable• Add fields to a PivotTable• Apply PivotTable styles• Format PivotTable Value Fields• Rearrange a PivotTable
159
Filtering a PivotTable
• Filtering a PivotTable enables the user to view a subset of the total data in the PivotTable
• Two kinds of filters can be used in a PivotTable– Report filter – can use a field not in the
PivotTable– Field filter – filters existing fields in the PivotTable
160
161
Adding a Report Filter
• Drag the desired filter field to the Report Filter area in the PivotTable Field List dialog box
• Select the filter values in the Report Filter field item drop down (above the PivotTable itself)
Filtering PivotTable Fields
• Filtering a field lets you focus on a subset of items in that particular field
• Click the field arrow button in the PivotTable that contains the data you want to filter
• Uncheck the check box for each item you want to hide
162
Refreshing a PivotTable
• You cannot change the data directly in the PivotTable. Instead, you must edit the data it is based on, and then refresh, or update, the PivotTable to reflect the updated data
• Click – PivotTable Tools Options tab
• Data group, – click the Refresh button
163
Grouping PivotTable Items
• When a field contains numbers, dates, or times, you can combine items by utilizing groups. (IE: group dates by: Month or Year)
• Excel creates groups automatically, based on the data.
• You can create your own groupings by selecting the row labels you want to group together, and then clicking Group Selection in the PivotTable Options tab. (Fixed value Group Ranges)
164
Creating a PivotChart
• A PivotChart is a graphical representation of the data in a PivotTable
• A PivotChart allows you to interactively add, remove, filter, and refresh data fields in the PivotChart similar to working with a PivotTable
• Click any cell in the PivotTable• Go to the PivotTable Tools Options tab
– Tools group • click the PivotChart button
165
Exercise
• Adding a report filter• Filtering PivotTable fields• Sorting PivotTable fields• Adding a second value field to a PivotTable• Grouping PivotTable items• Creating a PivotChart
166
This Page Blank for Duplex Printing