Enhance understanding of logical functions. Discuss using conditional logic focusing on: ◦ IF ◦...
-
Upload
eric-hodge -
Category
Documents
-
view
216 -
download
0
Transcript of Enhance understanding of logical functions. Discuss using conditional logic focusing on: ◦ IF ◦...
Enhance understanding of logical functions.
Discuss using conditional logic focusing on:◦ IF◦ SUMIF(s)◦ COUNTIF(s) ◦ AVERAGEIF(s)
While waiting for class to start, copy the lab class workbook to your u:drive or flash drive:
k:\IS201\IS201-edberg\LabFiles\LogicLab1.xlsx
1
Class Objectives (11/05/2013)
To establish pre-defined conditions with pre-defined results in a worksheet.
Many applications for conditional logic:◦ Highlight a cell with color based on an existing condition.
◦ Do calculations differently based on an existing condition such as: If sales > 1,000, then commission is 10% of sales, else commission is 5% of sales.
◦ Do functions differently based on an existing condition such as: Sum all the data that is associated with the word “nature”.
◦ Make decisions based on an existing condition such as: If credit rating type 1 is good and credit rating type 2 is good, then credit approval is TRUE, else credit approval is FALSE.
2
Purpose of using logical functions
Many Conditional Logic Functions Available
Conditional formatting.
TRUE/FALSE function: AND, OR
IF function: IF(condition, do this, else do this)
Error checking: ISERROR, ISBLANK
IF function wrapped with another function:◦ COUNTIF, SUMIF, AVERAGEIF◦ COUNTIFS, SUMIFS, AVERAGEIFS
Conditional table processing: ◦ VLOOKUP, HLOOKUP◦ Index and Match
3
4
Sample sheet for class presentation
Functions.◦ All functions have the same basic format.◦ Name of function. Beginning and ending
parentheses. Parameters within the parentheses.
Calculate an average using the average function.
Use the DATEDIF function to calculate the number of months an employee is employed.◦ DATEDIF(Firstdate, Seconddate, “unit of
measure”)◦ DATEDIF(C2, today(), “M”)
5
First tasks
Use COUNTIF, SUMIF, and AVERAGEIF functions to calculate a conditional count, sum, or average using only cells that meet a particular condition
Conditional count calculates the number of cells in a range that match specified criteria.◦ COUNTIF(field to check and count, criterion)
Conditional sum adds values in a range that match specified criteria.◦ SUMIF(field to check, criterion, field to total)
Conditional average calculates the means of values in a range that match specified criteria.◦ AVERAGEIF( field to check, criterion, field to average) 6
Summarizing data conditionally
SUMIFS(field to total, field to check, criterion, field to check, criterion, field to check, criterion)
AVERAGEIFS((field to average, field to check, criterion, field to check, criterion, field to check, criterion)
COUNTIFS(field to check and count, criterion, field to check and count, criterion)
7
Summarizing with more than one condition
IF relational condition
THEN
do something
ELSE
do something else
8
Overall structure of logical conditions
These types of logical computer decisions are black and white right or
wrong – there is no “gray” area.
How to do a logical condition in Excel:
IF(relational condition, what to do if true, what to do if false)IF(J2 > $f$30, “Over Average”, “Under Average”)