19
Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

Embed Size (px)

Citation preview

Page 1: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

1

Computer Science & Engineering 2111

Computer Science & Engineering 2111Lecture 4

COUNTIF(s)/SUMIF(s)/SUMPRODUCT/AVERAGEIF(s)/LARGE/SMALL/RANK

Page 2: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

2

COUNTIF FUNCTION

Counts the number of items in a range that meet a specific criteria

=COUNTIF(range, criteria)

• Range: A continuous range• Criteria: Determines what cells to count

Criteria Criteria Syntax Example

Number Type in number =COUNTIF(B3:B31,6)

Text Surround text in quotes =COUNTIF(B3:B31,”USA”)

Cell Reference Type in cell reference =COUNTIF(B3:B31,A2)

“Hard Coded” Boolean Expression

Surround Boolean expression in quotes =COUNTIF(B3:B31,”<=5”)

Cell Reference Boolean Expression

Surround Boolean expression in quotes and type & before the cell reference

=COUNTIF(B3:B31, “>” &B2)

Wild Card Use Asterisk =COUNTIF(B3:B31,”USA*”)

Page 3: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

3

Page 4: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

4

Page 5: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

5

Page 6: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

6

COUNTIFS FUNCTION

Counts the number of items in a range (using multiple criteria and multiple ranges) that meet a specific criteria

• All criterion must be true in order for the cell to be counted

=COUNTIFS(criteria_range1, criteria1,[criteria_range2,criteria2], …)

• Criteria_range1: A continuous range• Criteria1: Determines what cells to count

• Syntax rules the same as COUNTIF

Page 7: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

7

Page 8: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

8

SUMIF FUNCTION

Sums the number of items in a range that meet a specific criteria

=SUMIF(criteria_range, criteria,[sum_range])

• Criteria_Range: A continuous range• Criteria: Determines what cells to count• Sum_Range: If criteria is met, the computer will sum the

corresponding entry in this range• Same criteria syntax as COUNTIF

• If a sum_range argument is not used, the sum_range will be the same as the criteria_range

Page 9: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

9

Page 10: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

10

Page 11: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

11

SUMIFS FUNCTION

Sums a range (using multiple criteria and multiple ranges) that meet a specific criteria

• All criterion must be true in order for the cell to be summed

=SUMIFS(sum_range, criteria_range1,criteria1[criteria_range2,criteria2], …)

• Sum_Range: Range to sum if criterion are met• Criteria_Range1: Range of first criteria• Criteria1: Criteria for range1

• Criteria syntax rules the same as COUNTIF

Page 12: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

12

Page 13: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

13

AVERAGEIF and AVERAGEIFS FUNCTION

=AVERAGEIF(criteria_range, criteria,[average_range])Averages the number of items in a range that meet a specific criteria

=AVERAGEIFS(average_range, criteria_range1,criteria1[criteria_range2,criteria2], …)

Averages a range (using multiple criteria and multiple ranges) that meet a specific criteria

• All criterion must be true in order for the cell to be averaged.

Page 14: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

14

SUMPRODUCT FUNCTION

Multiplies corresponding components in the given arrays, and returns the sum of those products.

=SUMPRODUCT(array1, [array2], [array3], …)

• array1: The first array argument whose components you want to multiply and then add

• The array arguments must be the same dimension• Treats non-numeric cells as 0

Page 15: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

15

Page 16: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

16

LARGE and SMALL FUNCTION

=LARGE(array, k)Returns the k-th largest value in a range

• Array: A continuous range• k: The position (from the largest) in the array (range)

=SMALL(array, k)Returns the k-th smallest value in a range

• Array: A continuous range• k: The position (from the smallest) in the array (range)

Page 17: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

17

Page 18: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

18

RANK.EQ FUNCTION

Returns the rank of a number in a list of numbers

=RANK.EQ(number, ref, [order])

• Number: The number whose rank you want to find• Ref: The Array or range of values to rank• Order: A number specifying how to rank the numbers

– 0 or omitted: Ranks in descending order– 1: Ranks in ascending order

Page 19: Computer Science & Engineering 2111 Lecture 4 COUNTIF(s)/SUMIF(s)/SUMPRODUCT/ AVERAGEIF(s)/LARGE/SMALL/RANK 1

19