Ton Duc Thang University
Center for Applied Information Technology
Course Lecture
Website: cait.tdtu.edu.vn
Facebook: https://facebook.com/trungtamtinhoc
Course Materials
• Textbooks:
– Joan Lambert, MOS 2016 Study Guide for Microsoft Excel,
2017.
• References:
– Joan Lambert, MOS 2016 Study Guide for Microsoft
PowerPoint, 2017.
– John Wiley, Microsoft Official Academic Course, Microsoft
Word core 2016, 2016.
12/10/2018 Chapter 5. Applying Formulas and Functions 2
Ton Duc Thang University
Chapter 5. Applying Formulas and Functions
5.5 Logical functions
5.6 IF function
5.7 Advanced statistical functions
12/10/2018 Chapter 5. Applying Formulas and Functions 4
Chapter 5. Applying Formulas and Functions
5.5 Logical functions
5.6 IF function
5.7 Advanced statistical functions
12/10/2018 Chapter 5. Applying Formulas and Functions 5
5.5- Logical functions
- AND function:
+ Syntax: AND(logical 1, [logical2],…)
+ Arguments: logical1, logical2… are logical values or logical formulas.
+ Task: Returns TRUE if all of the arguments evaluate to TRUE, return
FALSE if any argument evaluates to FALSE.
Example:
• Ex1: AND(5>3,4<6,5>5) → The result is FALSE
• Ex2: ND(5>3,4<6,5>=5) → The result is TRUE
• Ex3: The formula
The result
12/10/2018 Chapter 5. Applying Formulas and Functions 6
5.5- Logical functions
- OR function:
+ Syntax: OR(logical 1, [logical2],…)
+ Arguments: logical1, logical2… are logical values or logical formulas.
+ Task: Returns TRUE if any argument evaluates to TRUE, return FALSE if all
arguments evaluate to FALSE.
Example:
• Ex1: OR(5>3,4>6,5>5) → The result is TRUE
• Ex2: OR(5<3,4>6,5>5) → The result is FALSE
• Ex3: The formula
The result
12/10/2018 Chapter 5. Applying Formulas and Functions 7
Chapter 5. Applying Formulas and Functions
5.5 Logical functions
5.6 IF function
5.7 Advanced statistical functions
12/10/2018 Chapter 5. Applying Formulas and Functions 8
5.6- Hàm điều kiện IF
- IF function:
+ Syntax : IF(logical_test, [value_if_true], [value_if_false])
+ Arguments:
• logical_test: logical values, logical formulas or logical function.
• value_if_true: return value for TRUE result of logical_test.
• value_if_false: return value for False result of logical_test.
+ Task: Test for a specific condition, return value_if_true for the TRUE
condition, return value_if_false for the FALSE condition.
Example: In cell A1, enter number 7. In another cell, enter a formula:
=IF(A1>=5, “ĐẬU”, “RỚT”) → The result is ĐẬU
12/10/2018 Chapter 5. Applying Formulas and Functions 9
5.6- Hàm điều kiện IF
- Example for the nested IF: use formulas to fill data for the Chức vụ and the PCCV
columns
Enter formula in cell D4: =IF(C4=“TP”,“Trưởng phòng”,IF(C4=“PP”,“Phó phòng”,“Nhân viên”))
Enter formula in cell E4: =IF(C4=“TP”,300000,IF(C4=“PP”,170000,0))
12/10/2018 Chapter 5. Applying Formulas and Functions 10
Chapter 5. Applying Formulas and Functions
5.5 Logical functions
5.6 IF function
5.7 Advanced statistical functions
12/10/2018 Chapter 5. Applying Formulas and Functions 11
5.7- Advanced statistical functions
- COUNTIF function:
+ Syntax: COUNTIF( range, criteria)
+ Arguments:
• range: The range of cells to count.
• criteria: The criteria that controls which cells should be counted.
+ Task: counts the number of cells in a range that match supplied criteria.
Notice: You can use the wildcard characters - the question mark (?) and asterisk
(*) as the criteria argument. A question mark represents any single character, an
asterisk represents any series of character.
12/10/2018 Chapter 5. Applying Formulas and Functions 12
5.7- Advanced statistical functions
- Example: Use formulas to fill data in 2 statistic tables.
Enter formula in cell C15: =COUNTIF($J$7:$J$11,B15)
Enter formula in cell H15: =COUNTIF($A$7:$A$11,G15&“*”)
12/10/2018 Chapter 5. Applying Formulas and Functions 13
5.7- Advanced statistical functions
- SUMIF function:
+ Syntax: SUMIF( range, criteria, [sum_range])
+ Arguments:
• range: The range of cells that you want evaluated by criteria.
• criteria: The criteria that controls which cells should be added.
• sum_range: The actual cells to add. If omitted, range is used.
+ Task: to sum the values in a range that meet criteria that you specify.
Notice: You can use the wildcard characters - the question mark (?) and asterisk
(*) as the criteria argument.
12/10/2018 Chapter 5. Applying Formulas and Functions 14
5.7- Advanced statistical functions
- Example: Use formulas to fill data in 2 statistic tables.
Enter formula in cell F16: =SUMIF($A$6:$A$11,E16,$F$6:$F$11)
Enter formula in cell I16: =SUMIF($A$6:$A$11,H16&“*”,$F$6:$F$11)
12/10/2018 Chapter 5. Applying Formulas and Functions 15
5.7- Advanced statistical functions
- Function AVERAGEIF:
+ Syntax: AVERAGEIF(range, criteria, [average_range])
+ Arguments:
• range: The range of cells that you want evaluated by criteria.
• criteria: The criteria that controls which cells should be averaged .
• average_range: The actual set of cells to average. If omitted, range is used.
+ Task: Returns the average (arithmetic mean) of all the cells in a range that meet
a given criteria.
Notice: You can use the wildcard characters - the question mark (?) and asterisk
(*) as the criteria argument.
12/10/2018 Chapter 5. Applying Formulas and Functions 16
5.7- Advanced statistical functions
- Example:
Relative range reference if the
formula is not copied
Absolute range reference if the formula is copied
12/10/2018 Chapter 5. Applying Formulas and Functions 17
Chapter 5. Applying Formulas and Functions
5.5 Logical functions
5.6 IF function
5.7 Advanced statistical functions
12/10/2018 Chapter 5. Applying Formulas and Functions 18