In this article, we will learn how to know if a range contains specific text or not.
For instance, you have a large list of data and you need to find the presence of substrings in a range using excel functions. For this article we will need to use 2 functions:
SUMPRODUCT function is a mathematical function in Excel. It operates on multiple ranges. It multiplies the corresponding arrays and then adds them.
The COUNTIF function of excel just counts the number of cells with a specific condition in a given range.
A wildcard is a special character that lets you perform indefinite matching on text in your Excel formulas.
There are three wildcard characters in Excel
Generic formula:
Explanation:
Example:
Here we have data in range A2 : A7. we need to find the presence of Colors in Range using this formula.
Use the Formula:
Explanation:
= SUMPRODUCT ( COUNTIF ( range , { *Red* ; "Green" ; "Blue" ))>0
=SUMPRODUCT ( { 1 ; 1 ; 1 } ) > 0
Here the range is named range for A2 : A7 & Colors named for the substrings in C2 : C4.
As you can see in the above snapshot, the formula returns TRUE stats that the substring colors are found in the Range values.
Notes:
Hope this article about whether Range contains value using wildcards in Excel is explanatory. Find more articles on SUMPRODUCT functions here. Please share your query below in the comment box. We will assist you.
Related Articles
How to use the SUMPRODUCT function in excel
How to use the COUNTIF function in excel
How to use the WILDCARDS function in excel
How to Remove Text in Excel Starting From a Position
Create drop down list in excel with colour
Remove leading and trailing spaces from text in Excel
Popular Articles
If with conditional formatting
Join first and last name in excel
Count cells which match either A or B
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.