In this article, we will learn how to lookup a certain text and returns the certain text using Excel functions.
How to solve the problem?
If we need to find a text string in Excel, if cell contains the same text. Use a combination of the following functions in Excel.
Let’s look at this table below, here we took some strings. We have some text words to run the formula as example:
Use the formula under the TEXT column
Substring or certain text : tain
The SEARCH function searches for the text "tain" in the words. If it finds the text "tain" in the cell, it returns the position of the text in the words cell. In cell C4, we have text "Mountain". It contains the sub-string "tain" at position 5. Now the formula drops down to this IFERROR(IF(5,"tain"),"No"). IF function treats any value greater than 0 as TRUE. Hence we obtained the result as "tain".
If the SEARCH function unable to find the text, it would result #VALUE! error. This would have caused the entire IF function to result in #VALUE! error. If the inner expression results in error, the IFERROR function comes into action and returns the specified result for an error, which is a "NO" here.
Copy the formula in other cells, select the cells taking the first cell where the formula is already applied, use shortcut key Ctrl+ D.
As you can see the words which contain the substring, returns the substring or else it returns No.
If you just want to check if the given cell contains the specified string or not, you can strip out IFERROR and IF function from the above function and encapsulate SEARCH function with ISNUMBER function.
This will return a TRUE if the cell contains the specified text and FALSE if it does not.
The technique is the same as the above formula. The ISNUMBER function returns to TRUE if it is supplied with a numeric value. Else it returns false.
Hope you learned how to search with the use of SEARCH, IF and IFERROR.You can perform these tasks in Excel 2013 and 2010. Find more articles on search text here. Please do mention your views or questions below in the comment box. We will help you.
For more example click here
If you liked our blogs, share it with your friends on Facebook. And also you can follow us on Twitter and Facebook.
We would love to hear from you, do let us know how we can improve, complement or innovate our work and make it better for you. Write us at email@example.com
50 Excel Shortcut to Increase Your Productivity : Get faster at your task. These 50 shortcuts will make you work even faster on Excel.
How to use the VLOOKUP Function in Excel : This is one of the most used and popular functions of excel that is used to lookup value from different ranges and sheets.
How to use the COUNTIF function in Excel : Count values with conditions using this amazing function. You don't need to filter your data to count specific values. Countif function is essential to prepare your dashboard.
How to Use SUMIF Function in Excel : This is another dashboard essential function. This helps you sum up values on specific conditions.
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.