The COUNTIF function is one of the top 10 Excel functions every user should know. It helps count cells that meet a specific condition in your workbook. This makes it a powerful tool for analyzing data.
Don't use Filter to Count Rows ⛔
Using the Filter tool to count rows can be time-consuming, especially with large datasets. Because
- You must filter your dataset on a specific column
- Select your value in the filter dropdown list
- Visualize in the status bar the number of records
- And remember this number in your head because .... once you select a new item, this value will disappear.
The solution: The COUNTIF function 😃👍
The COUNTIF function does the same job
- The function counts all the rows on a specific criterion.
- A criterion is the value you select in the dropdown list in the filter
- But with the COUNTIF formula, you have the result immediately
- This saves time and reduces errors 🏆
How to use the COUNTIF function?
The function is very simple to use
- Range: The cells to check.
- Criteria: The condition to match.
=COUNTIF(range, criteria)
Now, if we want to count how many rows correspond to "Jeans" we have to write the following formula
But we can also replace the name "Jeans" by the value in cell F4.
How to Count with Multiple Criteria?
You cannot use COUNTIF for multiple criteria. Instead, use the COUNTIFS function.
- It counts rows that match more than one condition.
- You can use up to 256 criteria.
- For most tasks, 3-5 criteria are usually enough.