Class 10 Computer Science — Counting and adding with a condition
Work out what COUNTIF and SUMIF show for a sheet you are given, and read the test each of them is applying.
Name: ________________________
1.A sheet holds the words D1 = pen, D2 = bag, D3 = pen, D4 = cup and D5 = pen. What number does this formula show?
=COUNTIF(D1:D5, "pen")
2.What are the two things a COUNTIF is given?
- a) A test, and the number of cells that ought to pass it
- b) A range of cells to look at, and a test that each of those cells either passes or fails
- c) A range of cells, and the number that the cells in it are expected to add up to
- d) Two ranges of cells, the second saying which of the first to count
3.A sheet holds E1 = 10, E2 = 10 and E3 = 4. Read the comparison in the test very carefully. What number does this formula show?
=COUNTIF(E1:E3, ">10")
4.A COUNTIF over the eight cells H1:H8, with the test ">50", shows 3. How many of those eight cells hold 50 or less?
5.A sheet holds C1 = 4, C2 = 15, C3 = 9 and C4 = 20. What number does this formula show?
=SUMIF(C1:C4, ">=10")
6.A sheet holds F1 = 8, F2 = 14, F3 = 8 and F4 = 20. Match each formula to the number it shows.
- =COUNTIF(F1:F4, "8")
- =SUMIF(F1:F4, ">10")
- =COUNTIF(F1:F4, ">5")
- =SUMIF(F1:F4, "8")
- =COUNTIF(F1:F4, ">14")
- 16
- 1
- 34
- 4
- 2
7.A COUNTIF over a column of words is given the test "pen". Which cells does it count?
- a) Every cell that has anything at all written in it
- b) Every cell with the letters p, e and n somewhere in it
- c) Only the cells that say pen and nothing else
- d) The cells sitting in the same rows as the cells that say pen
8.A sheet holds B1 = 12, B2 = 30, B3 = 5, B4 = 22 and B5 = 30. What number does this formula show?
=COUNTIF(B1:B5, ">20")
Answer key — Class 10 Computer Science — Counting and adding with a condition
- 1. 3
- 2. b) A range of cells to look at, and a test that each of those cells either passes or fails
- 3. 0
- 4. 5
- 5. 35
- 6. =COUNTIF(F1:F4, "8") → 2; =SUMIF(F1:F4, ">10") → 34; =COUNTIF(F1:F4, ">5") → 4; =SUMIF(F1:F4, "8") → 16; =COUNTIF(F1:F4, ">14") → 1
- 7. c) Only the cells that say pen and nothing else
- 8. 3