If cell contains text then display in Excel
If you have a list of text strings in column A, and a row of keywords, now, you need to check if the keywords are appear in the text string. If the keywords appear in the cell, displaying it, if not, blank cell is displayed as following screenshot shown.
If cell contains text then display in Excel
To solve this task, you should use the SERACH, ISNUMBER and IF functions together. The generic syntax is:
- substring: the word that you want to find if it appears in the text string.
- text: the text string that you want to check from.
1. Please enter or copy the following formula into cell C2:
2. Then, drag the fill handle to right to display all the texts which appear in the cell A2 based on the corresponding row data, see screenshot:
3. Keep on dragging the fill handle down to the cells that you want to apply this formula, and you will get the result as below screenshot shown:
Explanation of the formula:
- SEARCH(C$1,$A2): the SEARCH function is used to check if the searched value in C1 is appears in A2, if the search string is found, the SEARCH will return the position (a number), if not found, an error value #VALUE! is returned.
- ISNUMBER(SEARCH(C$1,$A2)): the ISNUMBER function will return TRUE if the search found, return FALSE if not found.
- IF(ISNUMBER(SEARCH(C$1,$A2)),C$1,""): IF function is used to return the value of C1 if the ISNUMBER result is TRUE, the ISNUMBER result is FALSE, an empty string is returned.
Relative functions used:
- SEARCH:
- The SEARCH function can help you to find the position of a specific character or substring from the given text string.
- IF:
- The IF function is used to test for a specific condition, returns the corresponding value that you supply for TRUE or FALSE.
- ISNUMBER:
- The ISNUMBER function returns TRUE when a cell contains a number, and FALSE if not.
More articles:
- Check If Cell Equals Any Value In List
- For example, I have a list of text strings in column A, and now, I want to check if cell value in this column equals any value in another list of column E. If equals, display TRUE, otherwise, a FALSE value is displayed as below screenshot shown.
- Check If Cell Contains One Of Many Things
- This tutorial provides a formula to check if a cell contains one of several values in Excel, and explains the arguments in the formula and how the formula work.
- Check If A Cell Contains A Specific Text
- Here the tutorial provides some formulas to check if a cell contains a specific text and return TRUE and FALSE as below screenshot shown, and explains the arguments and how the formulas works.
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...
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, Edge and Firefox.