Count cells equal to a specific value

April 21, 2022

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

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

Count cells equal to a specific value

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.

About me
Radu from ExcelExplained

My name is Radu Meghes, and I'm the owner of excelexplained.com. Over the past 15+ years, I have been using Microsoft Excel in my day-to-day job. I’ve worked as an investment and business analyst, and Excel has always been my most powerful weapon. Its flexibility and complexity make it a highly demanded skill for finance employees. I launched excelexplained.com back in 2017, and it has become a trusted source for Excel tutorials for hundreds of thousands of people each year.

If you'd like to get in touch, you can contact me on LinkedIn.

Thousands of people have benefited from my free Excel lessons. My only question is, will you be next?

Essential Functions

Popular Articles

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-2022 ExcelExplained.com
>