DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

25
DECISIONS AND FUNCTIONS Module 4.2

description

Content  Calculations based on a decision or test Calculations based on a decision or test  The VLOOKUP function The VLOOKUP function  Test and improve your knowledge and skills Test and improve your knowledge and skills 3

Transcript of DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

Page 1: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

DECISIONS AND FUNCTIONSModule 4.2

Page 2: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

DECISIONS AND FUNCTIONSModule 4.2

IF

COUNTIF

SUMIFVLOOKUP

Page 3: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

3

Content Calculations based on a decis

ion or test The VLOOKUP function Test and improve your knowl

edge and skills

IF

COUNTIF

SUMIF

VLOOKUP

Page 4: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

4

Calculations based on a decision or test

IF

COUNTIF

SUMIF

Page 5: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

5

COUNTIF and SUMIF functions

Function What the function does

= COUNTIF(range, criterion)

Counts the number of cells in a range that meet a certain criterion. Such a criterion can be a number, text or expression.

=SUMIF(range, criterion, sum_range)

The cells in the sum_range which correspond to the cells in the range that meet the criterion are added together.

Page 6: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

6

Example - application of the COUNTIF and SUMIF functions

Page 7: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

7

COUNTIf is used to count how many choir members are in each grade.

The total amounts paid by the choir members in each grade is calculated using SUMIF.

Page 8: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

8

IF function

=IF(condition, value_if_true, value_if_false)

=IF(D2>800, “Gold”, IF(D2>=600, “Silver”, “Bronze”))

Condition Value_if_true Value_if_false

Page 9: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

9

IF function

TRUEIF(D2>800

“Gold”

FALSE

If the value is greater than 800, the word Gold will be displayed, otherwise the Value_if_false part is executed.

This part consists of the next IF function where the value in D2 is tested again.

IF(D2>=600TRUE “Silver”

FALSE “Bronze”

=IF(D2>800, “Gold”, IF(D2>=600, “Silver”, “Bronze”))

Page 10: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

10

IF function - Insert Function

Page 11: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

11

Activity 1

IF

COUNTIF

SUMIF

Page 12: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

12

Activity 2

TryNestedIF

ABC_printing

Overtime

Marks

IF

COUNTIF

SUMIF

Page 13: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

13

VLOOKUP stands for Vertical Lookup which means that a value is searched for from top to bottom in a column.

The VLOOKUP function

VLOOKUP

Page 14: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

14

Looking up a specific value

The table where you search for the answerThe column number in the table where the answer is Use FALSE if you want to search for an exact value

2nd column

The value you want to search for

=VLOOKUP(Lookup_value, Table_array, Col_index_num, Range_lookup)

Page 15: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

15

Activity 3

CostsCourses

VLOOKUP

Page 16: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

16

Activity 4

BooksOutstanding

OnlineCourses

Increase_Stationery

StudyOppBooks

VLOOKUP

Page 17: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

17

Looking up a value in an interval

The following table shows how the conversion must be done.Marks Symb

ol90-100 A+80-89 A70-79 B60-69 C50-59 D40-49 E34-39 F30-33 FF10-29 G0-9 H

To do the conversion with the help of a VLOOKUP, the intervals must first be sorted from smallest to largest.Marks Symbol0-9 H10-29 G30-33 FF34-39 F40-49 E50-59 D60-69 C70-79 B80-89 A90-100

A+

Only the minimum values of each interval are stored in the lookup table in Excel.

  A B1 Mark

sSymbol

2 0 H3 10 G4 30 FF5 34 F6 40 E7 50 D8 60 C9 70 B

10 80 A11 90 A+

When intervals are used, TRUE must be the last argument in the VLOOKUP function.

Page 18: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

18

Activity 5

SchoolMarks

Medals

Bonuses_Gifts

VLOOKUP

Page 19: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

19

Test and improve your knowledge and skills

IF

COUNTIF

SUMIFVLOOKUP

Page 20: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

20

Summary of moduleThe COUNTIF and SUMIF functions

How many boys?How many girls?

Hoy many Gr 11s? How many Gr 12s?COUNTIF

Counts the number of cells in a range with a

particular value

Page 21: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

21

Summary of moduleThe COUNTIF and SUMIF functions

SUMIFAdds the values of

those cells where the corresponding column

has a certain value.

What is the total amount paid by Gr 10?

Page 22: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

22

Summary of module

The IF statement• The nested IF statement = an IF statement

within an IF statement.• When you use a nested IF statement the

conditions must be entered in the correct order. Begin with the largest, e.g.

= IF(B2>=80,”A”,IF(B2>=70,”B”,IF(B2>=60,”C”,”D”)))• In a nested IF statement make sure that the

number of left and right-hand brackets agree. Check that every IF function has a closing bracket at the end.

Page 23: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

23

Summary of module

The VLOOKUP function• Use a VLOOKUP function - too many IF

functions to use in a nested IF function.• Be careful when you select the column – the

number of the column, (2 and 3) , not the name of the column.

• When the VLOOKUP function has to be copied to other cells in a column, use absolute referencing for the lookup table, e.g. =VLOOKUP(C2,$F$1:$G$5,2,FALSE)

• It is important that the values are sorted from low to high when you use a VLOOKUP function with intervals. The lowest must be at the top of the table.

Page 24: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

24

Written module activity

IF

COUNTIF

SUMIFVLOOKUP

Page 25: DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.

25

Practical module activity

Awards

FundRaising

Swimming

ReadingCompetition

IF

COUNTIF

SUMIFVLOOKUP