Excel Contains FunctionOne commonly practised task in Excel is checking whether a cell contains a particular value or not. But the irony is that no default inbuilt function can help you look for a value or number, specific text, or any other value apart from the non-empty cell. Now the question arises of how to check if a cell contains a specific text or not? Don't worry. Though Microsoft Excel has not introduced any contains function, you can use the in-built ISNUMBER and SEARCH function to quickly check if a cell contains the text in your worksheet. Now the question arises of how to check if a cell contains a specific text or not? Don't worry. Though Microsoft Excel has not introduced any contains function, you can use the in-built ISNUMBER and SEARCH function to quickly check if a cell contains the text in your worksheet. Before moving ahead with the steps let's have a brief introduction about SEARCH and ISNUMBER function. What is Search Function?"The inbuilt SEARCH function in Excel returns the location of a substring inside the specified string. This function returns the position of the first character of find_text inside within_text. Unlike FIND function, the SEARCH function doesn't permit the wildcards, and it is not case-sensitive (the upper case and lower case letters are considered different)." Syntax Parameter
Return This function returns the location of a substring another a main string. What is ISNumber Function?"The inbuilt ISNUMBER function in Excel will return a Boolean TRUE if a cell contains the specified number, and FALSE if it doesn't not contain the same. You can incorporate the ISNUMBER to check that a cell contains a numeric value, or that the output of another function is a number." Syntax Parameter Value (required): This parameter represents the specified value to check. Return This function will return a Boolean TRUE if a cell contains the specified number, and FALSE if it doesn't not contain the same. You can incorporate the ISNUMBER to check that a cell contains a numeric value, or that the output of another function is a number. Steps to implement CONTAINS function in ExcelWe are given a data below where in the substring column we are given substring to check whether they are contained in the main string or not. To match if a cell contains specific text, we can utilize the SEARCH function combined with the Excel ISNUMBER function. In simple terms, we always look for a substring in the specific text, and text defines text in the cell you are testing. Following are the steps to use the SEARCH and ISNUMBER function in Excel:
NOTE: You can also check if a cell contains specific text, without showing the substring. Make sure to encircle the substring in double quotation marks.Case sensitive versionIf you want the formula to be case-sensitive, you can replace the SEARCH function with the FIND function. What is Find Function?"The inbuilt Excel FIND function returns the position (in a numeric format) of the specified substring in the given main string. If the text is found, it returns the numeric position; if the text is not found, the function returns a #VALUE error." Syntax Parameter
Return This function returns a numeric value representing the location of location of the substring inside the main string. STEPs to incorporate the CONTAIN function using FINDThe FIND function will return if the position of the substring is found in the main string and it returns the #VALUE! error if the value is not found. We use incorporate this characteristic to check whether the substring is found by using the ISNUMBER function to "catch" valid numeric positions. Following are the steps to use the FIND and ISNUMBER function in Excel:
With specific search stringWhile working with Excel, we often require testing a cell for a specific hardcoded search substring. Excel extends the capabilities to match a series of zero or more characters with IF and COUNTIF functions. Before moving ahead with the steps let's have a brief introduction about COUNTIF function. What is COUNTIF Function?"The COUNTIF function in Excel counts the number of cells that meet a criterion. This function is used to count the number of cells that contain dates, numbers, and text." Syntax Parameter Range (required) - This parameter represents the text to find. Criteria(required)- This parameter represents the criteria that checks and filter the cells that should be counted. Return This function returns a number representing cells counted. STEPs to incorporate the CONTAIN function using IF and COUNTIFYou can also use IF and COUNTIF in Excel to check if a cell contains specific text. However, unlike the SEARCH function, the COUNTIF function is also case-insensitive (uppercase and lowercase letters are considered same). Following are the steps to use the IF and COUNTIF function in Excel:
That's it! Now you can easily check whether a cell contains specific text or not. Incorporate the above formulas per your requirement and be ahead of your peer group. Next TopicExcel Gauge Chart |