Excel Study · Module 3: Decisions with IF

Class 29COUNTIF

Intermediate1:21 videoFree

COUNTIF counts the cells that match one condition: how many orders were Tea? Give it the range and what to look for, in quotes. Better still, point it at a cell that holds the word, so one formula answers for any product you type.

Try this AI prompt

Works in ChatGPT, Gemini, Copilot or Claude.

In Excel, B2:B9 has product names. Write a formula for E4 that counts how many of them are Tea.

The answer that works

✓ checked in Excel
=COUNTIF(B2:B9,"Tea")

AI can get Excel wrong. Paste its answer into Excel and test it before you trust it.

Sources: Microsoft support