Module 6 · Conditional Sums and Counts
How many e-bikes

Fatima gives every bike a name. On Sunday, 16 rentals went out. Fatima wants to know which bike types are popular. You count them with COUNTIF.
Steps
Count cells with COUNTIF
COUNTIF counts the cells in a range that match a condition.
How to do it
- Select the cell for the result.
- Type =COUNTIF(
- Type the range to look in. Type a comma.
- Type the condition and a closing bracket. Put text in quotation marks.
- Press Enter.
=COUNTIF(C5:C20,"City")Task: Count the E-bike rentals. Put the number in cell H6.
Use a cell as the condition
The condition can be a cell. Then you can copy the formula. Lock the range with $ first.
How to do it
- Click cell H7.
- Lock the range with $ if you want to copy the formula.
- Type the cell with the condition and a closing bracket.
- Press Enter.
=COUNTIF($C$5:$C$20,G7)Task: Count the Kids bike rentals in cell H8. Use cell G8 as the condition.
Count numbers with a comparison
The condition can compare numbers, for example ">3". Put the comparison in quotation marks.
How to do it
- Click cell H10.
- Type =COUNTIF(D5:D20,
- For a comparison, type it in quotation marks, for example ">3" or "<=2".
- Press Enter.
- To count one exact number, type the number without quotation marks, for example =COUNTIF(D5:D20,2).
=COUNTIF(D5:D20,">3")Task: Count the rentals of exactly 1 hour. Put the number in cell H11.