glade manual – chapter 3 1 e.g. in exercise 2: kasch pulse recovery study - we want to identify...

7
Glade Manual – Chapter 3 1 e.g. In exercise 2: Kasch Pulse Recovery Study - We want to identify the “Fitness Rating” for a list of people based on their “Pulse Rate” readings: Nested “IF” function: The IF function template require three arguments – a logical test, the value to return if the test is true, and the value to return if the test is false. In this example there is not just one logical test – there are 5! EECS 1520 -- Computer Use: Fundamentals

Upload: christian-hodge

Post on 28-Dec-2015

232 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Glade Manual – Chapter 3 1 e.g. In exercise 2: Kasch Pulse Recovery Study - We want to identify the “Fitness Rating” for a list of people based on their

Glade Manual – Chapter 3

1

e.g. In exercise 2: Kasch Pulse Recovery Study- We want to identify the “Fitness Rating” for a list of people

based on their “Pulse Rate” readings:

• Nested “IF” function:

The IF function template require three arguments – a logical test, the value to return if the test is true, and the value to return if the test is false. In this example there is not just one logical test – there are 5!

EECS 1520 -- Computer Use: Fundamentals

Page 2: Glade Manual – Chapter 3 1 e.g. In exercise 2: Kasch Pulse Recovery Study - We want to identify the “Fitness Rating” for a list of people based on their

Glade Manual – Chapter 3

2

• Nested “IF” function:

The logical implementation would be:if(Less than 80, “Excellent”,

if(80 to <90, “Good”,if(90 to <105, “Average”,

if(105 to <115, “Fair”, “Poor”))))

0 9080 105 115

Fair PoorAverageExcellent Good

TrueFalse

TrueFalse

TrueFalse

TrueFalse

Nested “if”

EECS 1520 -- Computer Use: Fundamentals

Page 3: Glade Manual – Chapter 3 1 e.g. In exercise 2: Kasch Pulse Recovery Study - We want to identify the “Fitness Rating” for a list of people based on their

Glade Manual – Chapter 3

3

• “LOOKUP” function: - Instead of using “Nested-if” function for the above scenario, the

“LOOKUP” function can be used to simplify the implementation

- In Excel: “=LOOKUP(lookup_value, lookup_vector, result_vector)”- There are 3 items need to be referred to.

Original data Result

Original data worksheet

Lookup table worksheet

Length of lookup_vector = length of result_vector

EECS 1520 -- Computer Use: Fundamentals

Page 4: Glade Manual – Chapter 3 1 e.g. In exercise 2: Kasch Pulse Recovery Study - We want to identify the “Fitness Rating” for a list of people based on their

Glade Manual – Chapter 3

4

• “LOOKUP” function:

- In exercise 5, you are asked to determine the “Fitness Rating” of a list of people depends on their gender.

The basic idea is to say:If (subject is male, lookup the table for males, lookup the table for females)

EECS 1520 -- Computer Use: Fundamentals

Page 5: Glade Manual – Chapter 3 1 e.g. In exercise 2: Kasch Pulse Recovery Study - We want to identify the “Fitness Rating” for a list of people based on their

Glade Manual – Chapter 3

5

This exercise also introduces the idea of a compound logical test involving the use of the “AND” and “OR” functions

In this exercise:

• Exercise 3 (Sales Discount Model):

If ( it’s a women’s clothing item AND it’s not selling well), discount by 25% , otherwise no discount

The basic idea is to say:

IF (it’s a women’s clothing item AND it’s not selling well)

Value_if_true: discount by 25%Value_if_false: no discount

Logical 1 Logical 2

EECS 1520 -- Computer Use: Fundamentals

Page 6: Glade Manual – Chapter 3 1 e.g. In exercise 2: Kasch Pulse Recovery Study - We want to identify the “Fitness Rating” for a list of people based on their

Glade Manual – Chapter 3

6

• Exercise 3 (Sales Discount Model):

IF (it’s a women’s clothing item AND it’s not selling well)

Value_if_true: discount by 25%Value_if_false: no discount

Note: “women’s clothing” is labeled as “CW” in the “Product Code”

Logical 1: are the first two characters of product code = CW?Logical 2: “not selling well” means “Stock_Quantity > 15*Average_Daily_Sales”

Logical 1 Logical 2

EECS 1520 -- Computer Use: Fundamentals

Page 7: Glade Manual – Chapter 3 1 e.g. In exercise 2: Kasch Pulse Recovery Study - We want to identify the “Fitness Rating” for a list of people based on their

Glade Manual – Chapter 3

7

Exercise 1 (Sales Person Bonus Model) [formula view]Use “IF” function to determine the “Bonus” of a salesperson

Exercise 3 (Sales Discount Model) [formula view]Use “AND” and “LEFT” (i.e. from the Text group of functions) functions in a “IF” logical statement to determine which “clothing – women’s” items need to give a discount of 25%

Exercise 5 (Kasch Pulse Recovery Study Again) [formula view]Use “IF” and “LOOKUP” functions to determine the “Fitness Rating” for both men and women

• Homework 3:

EECS 1520 -- Computer Use: Fundamentals