Enhance understanding of logical functions. Discuss using conditional logic focusing on: ◦ IF ◦...

8
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)

Transcript of Enhance understanding of logical functions. Discuss using conditional logic focusing on: ◦ IF ◦...

Page 1: Enhance understanding of logical functions.  Discuss using conditional logic focusing on: ◦ IF ◦ SUMIF(s) ◦ COUNTIF(s) ◦ AVERAGEIF(s)  While waiting.

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)

Page 2: Enhance understanding of logical functions.  Discuss using conditional logic focusing on: ◦ IF ◦ SUMIF(s) ◦ COUNTIF(s) ◦ AVERAGEIF(s)  While waiting.

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

Page 3: Enhance understanding of logical functions.  Discuss using conditional logic focusing on: ◦ IF ◦ SUMIF(s) ◦ COUNTIF(s) ◦ AVERAGEIF(s)  While waiting.

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

Page 4: Enhance understanding of logical functions.  Discuss using conditional logic focusing on: ◦ IF ◦ SUMIF(s) ◦ COUNTIF(s) ◦ AVERAGEIF(s)  While waiting.

4

Sample sheet for class presentation

Page 5: Enhance understanding of logical functions.  Discuss using conditional logic focusing on: ◦ IF ◦ SUMIF(s) ◦ COUNTIF(s) ◦ AVERAGEIF(s)  While waiting.

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

Page 6: Enhance understanding of logical functions.  Discuss using conditional logic focusing on: ◦ IF ◦ SUMIF(s) ◦ COUNTIF(s) ◦ AVERAGEIF(s)  While waiting.

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

Page 7: Enhance understanding of logical functions.  Discuss using conditional logic focusing on: ◦ IF ◦ SUMIF(s) ◦ COUNTIF(s) ◦ AVERAGEIF(s)  While waiting.

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

Page 8: Enhance understanding of logical functions.  Discuss using conditional logic focusing on: ◦ IF ◦ SUMIF(s) ◦ COUNTIF(s) ◦ AVERAGEIF(s)  While waiting.

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”)