- •Solutions for Excel How to accomplish a common task in a fast, flexible and efficient way
- •Create sequential table rows and columns
- •Problem
- •Solution
- •Similar tasks
- •Fill blank range
- •Problem
- •Solution
- •Similar problems
- •Fill table with formulas with row and column inputs
- •Problem
- •Solution
- •Formula syntax
- •Similar tasks
- •Convert formula to its results
- •Problem
- •Solution
- •Similar tasks
- •A legible formula
- •Problem
- •Solution
- •Similar tasks
- •A dynamic date range
- •Problem
- •Solution
- •Formula syntax
- •Similar tasks
- •Check for a condition
- •Problem
- •Solution
- •Formula syntax
- •Similar problems
- •Select one from a range of options
- •Problem
- •Solution
- •Formula syntax
- •Similar tasks
- •Combine data from several data ranges in one
- •Problem
- •Solution
- •Formula syntax
- •Make 1 look as "q1"
- •Problem
- •Solution
- •Similar tasks
- •Problem
- •Solution
- •Similar tasks
- •Sum or count only certain values in a range
- •Problem
- •Solution
- •Formula syntax
- •Find data in a table
- •Problem
- •Solution
- •Formula syntax
- •Create a random password
- •Problem
- •Solution
- •Formula syntax
- •Get data from a cell n columns to the left or right
- •Problem
- •Solution
- •Formula syntax
- •A drop-down list of values
- •Problem
- •Solution
- •Similar tasks
- •Compare positive and negative numbers
- •Problem
- •Solution
- •Formula syntax
- •Similar tasks
- •Let formula read address name from an external cell
- •Problem
- •Solution
- •Formula syntax
- •Similar tasks
Similar tasks
Task 1.
Display 0.1 as 0.100
Solution
0.000
Task 2.
Display 0.1 as .1
Solution
To suppress insignificant zeroes, use hash (#) instead of zero.
#.#
Sum or count only certain values in a range
Tools: functions SUMIF, COUNTIF
Level: intermediate
Problem
You have a sequential list of grades for every student in your class. You need to compute average grades for every student that will be their final grades.
|
A |
B |
1 |
Student |
Grade |
2 |
Alisha |
3 |
3 |
Becky |
4 |
4 |
Cathleen |
3 |
5 |
Becky |
3 |
6 |
Alisha |
2 |
7 |
Becky |
3 |
8 |
Cathleen |
4 |
9 |
Alisha |
4 |
10 |
Cathleen |
4 |
11 |
Alisha |
3 |
Solution
A student's average grade is sum of her grades divided by number of her grades. We will use two conditional lookup functions SUMIF and COUNTIF in a single formula.
(OPTIONAL) Select range A2:A11 and name it "students".
(OPTIONAL) Select range B2:B11 and name it "grades".
Active cell C1. Type "Alisha"
Active cell C2. Enter function =SUMIF(students,C1,grades).
Active cell C3. Enter function =COUNIF(students,C1).
Active cell C4. Enter =C2/C3.
Type in cells D1 "Becky" and E1 "Cathleen".
Copy range C2:C4 to D2:E4.
|
A |
B |
C |
D |
E |
1 |
Student |
Grade |
Alisha |
Becky |
Cathleen |
2 |
Alisha |
3 |
12 |
10 |
11 |
3 |
Becky |
4 |
4 |
3 |
3 |
4 |
Cathleen |
3 |
3.00 |
3.33 |
3.67 |
5 |
Becky |
3 |
|
|
|
6 |
Alisha |
2 |
|
|
|
7 |
Becky |
3 |
|
|
|
8 |
Cathleen |
4 |
|
|
|
9 |
Alisha |
4 |
|
|
|
10 |
Cathleen |
4 |
|
|
|
11 |
Alisha |
3 |
|
|
|
You should get as a result the following table.
In practice, we could have just as well combined formulas in rows 2-4 in a single formula =SUMIF(students,C1,grades)/COUNTIF(students,C1).
