Get instant live expert help with Excel or Google Sheets
“My Excelchat expert helped me in less than 20 minutes, saving me what would have been 5 hours of work!”

Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Our professional experts are available now. Your privacy is guaranteed.

Range contains one of many values

Excel allows a user to check if a range contains one of many values from the other range, using the SUMPRODUCT and COUNTIF functions. This step by step tutorial will assist all levels of Excel users in comparing two ranges.

Figure 1. The result of the formula

Syntax of the COUNTIF Formula

The generic formula for the COUNTIF function is:

=COUNTIF(criteria_range, criteria)

The parameters of the COUNTIF function are:

  • criteria_range – a range where we want to apply our criteria
  • criteria – a criteria which we want to count.

Syntax of the SUMPRODUCT Formula

=SUMPRODUCT(--(array))

The parameters of the SUMPRODUCT function for counting with criteria are:

  • array – an array of values which we want to sum

Setting up Our Data for the Formula

Figure 2. Data that we will use in the example

Let’s look at the structure of the data we will use. We want to check if at least of the values from column C appears in column E. The formula returns True or False in the cell G3.

Checking if the Range Contains One of Many Values

The formula looks like:

=SUMPRODUCT(COUNTIF(C3:C9, E3:E9)) > 0

The criteria_range of the COUNTIF function is the C3:C9 range, while the criteria is E3:E9. The result of the function is the array parameter of the SUMPRODUCT function. Finally, the function sums all these values and check if the sum is greater than 0.

To apply the formula, we need to follow these steps:

  • Select cell G3 and click on it
  • Insert the formula: =SUMPRODUCT(COUNTIF(C3:C9,E3:E9))>0
  • Press enter

Figure 3. Using the formula to check ranges matching

As we can see in Figure 3, the result of the formula is TRUE. The value in the C5 (May 2018) appear in the range E3:E9.

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Solution examples
i have a table with Dates, First names , Last names and i want to count how many times a name occurs, but if a name occurs more than once on a particular date i need to only count it once. this is on excel and not google sheets
Solved by F. H. in 31 mins
I need a formula to count the number of rows that contain at least one of two possible phrases, but not give me the total number of instances that both phrases occur overall.
Solved by E. B. in 33 mins
I want to be able to alter the appearance (font color and fill) of a column of numbers using conditional formatting, based on being greater than or less than the numbers from another column. I am using Excel 2016. I am unable to get any formula to work. Please help!
Solved by I. J. in 59 mins
I need assistance with an excel formula. I have a 12 month sheet that has a summary page on the 13 page. the monthly totals changes so on the summary page I want to sum the difference - eg. if Jan total is 1500, feb total is 1000, mar total is 800, I want the summary page to show the current amount of 800 when you place the formula to capture all months---showing the diminishing value rather than the sum of all the pages
Solved by E. L. in 60 mins
how can i turn my sumifs into a countifs because my sumifs works great and i also want to count the thing im summing
Solved by O. C. in 40 mins

Leave a Comment

avatar

Subscribe to Excelchat.co

Get updates on helpful Excel topics

Subscribe to Excelchat.co

Did this post not answer your question?
Get a solution from connecting with the expert

Another blog reader asked this question today on Excelchat:

Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Our professional experts are available now. Your privacy is guaranteed.
Trusted by people who work at
Amazon.com, Inc
Facebook, Inc
Accenture PLC
Siemens AG
Macy's
The Allstate Corporation
United Parcel Service
Dell Inc