## Count number of cells equals to one of many values in Excel

Supposing, I have a list of products in column A, now, I want to get the total number of specific products Apple, Grape and Lemon which listed in range C4:C6 from column A as below screenshot shown. Normally, in Excel, the simple COUNTIF and COUNTIFS functions will not work in this scenario. This article, I will talk about how to solve this job quickly and easily with the combination of SUMPRODUCT and COUNTIF functions.

#### Count number of cells equals to one of many values

To count the number of cells that equals to one of many values, you can combine the COUNTIF function with the SUMPRODUCT function together. The generic syntax is:

=SUMPRODUCT(COUNTIF(range,things))
• range: The list of cells from which you want to count the number of specific items;
• things: Represents the values that you want to count.

1. Enter or copy the following formula into a blank cell where you want to output the result:

=SUMPRODUCT(COUNTIF(A2:A13,C2:C4))

2. And then press Enter key to get the total number of the specific values, see screenshot:

##### Explanation of the formula:
• COUNTIF(A2:A13,C2:C4): This COUNTIF function helps you to count cells in a range A2:A13 that are equal to the criterion listed in C2:C4, so, you will get this result: {2;1;3} which means Apple appears twice, Grape appears once and Lemon appears three times.
• SUMPRODUCT(COUNTIF(A2:A13,C2:C4))=SUMPRODUCT({2;1;3}): This SUMPRODUCT function is used to sum all items in the array and return a final result:6.

Notes:

1. You can also combine the ISNUMBER, MATCH and SUMPRODUCT functions to get the result as follows:

=SUMPRODUCT(--ISNUMBER(MATCH(A2:A13,C2:C4,0)))

2. These formulas are not case sensitive.

#### Relative function used:

• COUNTIF:
• The COUNTIF function is a statistical function in Excel which is used to count the number of cells that meet a criterion.
• SUMPRODUCT:
• The SUMPRODUCT function can be used to multiply two or more columns or arrays together, and then get the sum of products.

#### More articles:

• Count number of cells not equal to many values in Excel
• In Excel, you may easily get the number of cells not equal to a specific value by using the COUNTIF function, but have you ever tried to count the cells which are not equal to many values? For example, I want to get the total number of the products in column A but exclude the specific items in C4:C6 as below screenshot shown. This article, I will introduce some formulas for solving this job in Excel.
• Count Number Of Cells Not Between Two Given Numbers In Excel
• To count the number of cells between two numbers is a common task for us in Excel, but, in certain case, you may want to count the cells not between two given numbers. For example, I have a product list with the sales from Monday to Sunday, now, I need to get the number of cells which not between the specific low and high numbers as below screenshot shown. This article, I will introduce some formulas for dealing with this task in Excel.

### The Best Office Productivity Tools

#### Kutools for Excel - Helps You To Stand Out From Crowd

Would you like to complete your daily work quickly and perfectly? Kutools for Excel brings 300 powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) and save 80% time for you.

• Designed for 1500 work scenarios, helps you solve 80% Excel problems.
• Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands.
• Become an Excel expert in 3 minutes. No longer need to remember any painful formulas and VBA codes.
• 30-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years.

#### Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

• One second to switch between dozens of open documents!
• Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
• Increases your productivity by 50% when viewing and editing multiple documents.
• Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Firefox, And New Internet Explorer.