Count cells equal to a specific value

December 10, 2018

Counting cells that equal to a specific value can be achieved really fast using COUNTIF function. If you need to use multiple criteria you can also use COUNTIFS which allows for more flexibility.

How to count cells equal to a specific value

Count cells equal to a specific value

Our workbook contains data from restaurant orders, which include the item ordered by the customer and the amount paid. In the example shown, cell C2 contains the following formula:
=COUNTIF(products, B2)

Using COUNTIF function is straightforward. All you need to do is define the range where you want to search for the criteria and the criteria. In our case, we want to look at the range B7:B17 (named products) and count the number of times burgers were sold. COUNTIF returns the count of values in B7:B17 that is equal to "Burger". Changing the criteria (cell B2) to "Pizza" will return a different result.

You can download the Excel workbook if you want to take a closer look at this example.

Note: when you want to provide the criteria directly as text, you will need to use the double quotes "" in your formula. As an example, the above formula can also be written as =COUNTIF(products, "Burger") and it will return the same result.

What to do next?

I strongly recommend writing more formulas. You can do so by checking out my article on how to count cells between two dates using COUNTIFS.

If you have additional questions please let me know by posting a comment.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Essential Functions

Excel Topics

Excel courses

I have compiled a list of the best Excel online courses. It covers basic and advanced topics, VBA, and Power BI.
View courses
Excel is a very complex application, and understanding it on your own may prove difficult and time-consuming. I have created ExcelExplained.com to help you better understand each function and provide useful examples for different tasks. If you can’t find the answer to your question in one of the published articles, please leave a comment or send me an email, and I will do my best to help you out.

Affiliate Disclosure: When you purchase a product through a link on our website, I may earn an affiliate commission. There are no additional costs to you.
Copyright © 2017-2021 ExcelExplained.com