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

Fatima Haddad owns Ridgeline Bike Rental

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.

Loading the spreadsheet…

Module 6 · Conditional Sums and Counts

How many e-bikes

Fatima Haddad, owns Ridgeline Bike Rental
Fatima Haddad owns Ridgeline Bike Rental

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

  1. Count cells with COUNTIF

    COUNTIF counts the cells in a range that match a condition.

    How to do it

    1. Select the cell for the result.
    2. Type =COUNTIF(
    3. Type the range to look in. Type a comma.
    4. Type the condition and a closing bracket. Put text in quotation marks.
    5. Press Enter.

    =COUNTIF(C5:C20,"City")

    Task: Count the E-bike rentals. Put the number in cell H6.

  2. 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

    1. Click cell H7.
    2. Lock the range with $ if you want to copy the formula.
    3. Type the cell with the condition and a closing bracket.
    4. Press Enter.

    =COUNTIF($C$5:$C$20,G7)

    Task: Count the Kids bike rentals in cell H8. Use cell G8 as the condition.

  3. Count numbers with a comparison

    The condition can compare numbers, for example ">3". Put the comparison in quotation marks.

    How to do it

    1. Click cell H10.
    2. Type =COUNTIF(D5:D20,
    3. For a comparison, type it in quotation marks, for example ">3" or "<=2".
    4. Press Enter.
    5. 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.