DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.
-
Upload
bartholomew-parker -
Category
Documents
-
view
236 -
download
0
description
Transcript of DECISIONS AND FUNCTIONS Module 4.2. DECISIONS AND FUNCTIONS Module 4.2.
DECISIONS AND FUNCTIONSModule 4.2
DECISIONS AND FUNCTIONSModule 4.2
IF
COUNTIF
SUMIFVLOOKUP
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
4
Calculations based on a decision or test
IF
COUNTIF
SUMIF
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.
6
Example - application of the COUNTIF and SUMIF functions
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.
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
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”))
10
IF function - Insert Function
11
Activity 1
IF
COUNTIF
SUMIF
12
Activity 2
TryNestedIF
ABC_printing
Overtime
Marks
IF
COUNTIF
SUMIF
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
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)
15
Activity 3
CostsCourses
VLOOKUP
16
Activity 4
BooksOutstanding
OnlineCourses
Increase_Stationery
StudyOppBooks
VLOOKUP
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.
18
Activity 5
SchoolMarks
Medals
Bonuses_Gifts
VLOOKUP
19
Test and improve your knowledge and skills
IF
COUNTIF
SUMIFVLOOKUP
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
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?
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.
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.
24
Written module activity
IF
COUNTIF
SUMIFVLOOKUP
25
Practical module activity
Awards
FundRaising
Swimming
ReadingCompetition
IF
COUNTIF
SUMIFVLOOKUP