In this article, you will learn how to use the SEARCH formula in Google Sheets. The SEARCH formula returns an integer to show a position at which a particular string is found first in a specific text. Thus, the SEARCH function is beneficial when finding a particular word's location or a combination of letters in text strings. You can leverage this function even when you only need to know whether a word is contained in a text. Note this function is not case-sensitive. If you need a case-sensitive search, use the FIND formula instead.
The general syntax of this formula is as follows:
Search_for: a string you want to find in texts
Text_to_search: A text where this function looks for the specified keyword
Starting_at [Optional]: This argument determines where the search starts in the specified text. Without any input for this parameter, the function assumes it is 1 (=the first letter in the text string).
Note: If the function can’t find a match, it returns “#VALUE”.
Look at the following examples to understand how this formula works in Google Sheets.
The first and second examples: The difference between the first and second examples is the optional argument “Sarting_at”. In the second formula, with 6 in the “starting_at” parameter, the search starts at the sixth position, “e” at the end of “I like”. Note that the SEARCH formula counts the location number at which the specified string shows up from the beginning of the text, regardless of the “starting_at” argument.
The third and fourth examples: The SEARCH functions return “#VALUE” in the third and fourth examples. In the third one, with 8 in the “starting_at” parameter, the function starts looking for “nine” from “e” (at the end of “nice”), a letter positioned at the tenth place in the text. However, after “e”, there is no chunk of letters that match with “nine”, so the function returns “#VALUE”. Similarly, the formula can’t find “him” in the specified text of “I saw her”, and it provides you with “VALUE” here.
This fifth example: The last example represents one of the features of this function. Although “him” and “HIM” are not the same, as the SEARCH formula is not case-sensitive, they are considered the same by the function.
You have learned how the SEARCH formula works in Google Sheets. We explain another example in which we use the SEARCH function combined with the IFERROR and IF formulas to check whether a specific string is included in a chosen text. In this sample case, assume that we confirm whether each text contains “have” or not.
The upper table describes the two steps you need to take.
The first step is to use the SEARCH formula to confirm if “have” is contained in each text. In the “Outcome” column, we use the IFERROR formula to give a different value, “No”, to “#VALUE”, which shows up when there is no match in a search by the SEARCH function.
The second step is to give the answers to the question. In the “Include “have”?” column, we apply the IF function to show “No”, when the returned value by the IFERROR function is “No”, and otherwise, provide “Yes”, when the IFERROR formula gives us any numeric value.
The lower table shows the same results in a step in which we use IF formulas containing two functions - the SEARCH and the IFERROR.
These formulas are examples. Find a better combination of formulas that fit your purpose most.
Check the following articles if you are interested in formatting text in cells.
How to Make Text Bold, Italic, and Strikethrough in Google Sheets
How to Align Text in Google Sheets
How to Wrap Text in Cell in Google Sheets
How to Rotate Text in Google Sheets
How to Change Default Font in Google Sheets
How to Indent Texts in Google Sheets: Explained
How to Capitalize the First Letter in Google Sheets
How to Capitalize All Letters in Google Sheets
How to Make All Letters Lowercase in Google Sheets
TEXT Function in Google Sheets: Explained
Do you want to learn how to combine or split text in Google Sheets?
How to Combine Texts in Google Sheets
CONCAT Function in Google Sheets: Explained
How to Use the CONCATENATE function in Google Sheets
How to Split Texts into Columns in Google Sheets
How to Use SPLIT Function in Google Sheets
CHAR Function in Google Sheets: Explained
Do you want to know where a specify character or word is in a text string?
LEFT Function in Google Sheets: Explained
How to Use RIGHT Function in Google Sheets
FIND Function in Google Sheets: Explained
Do you need to replace a part of text with another characters or words?
How to Use REPLACE Function in Google Sheets
SUBSTITUTE Function in Google Sheets: Explained
Do you like to show a formulae in a cell?
How to Use FORMULATEXT Function in Google Sheets
This function is useful when you need to count the number of characters in a text string.
LEN Function in Google Sheets: Explained
Why don’t you double-check the spelling of your texts or cleaning up extra spaces before printing or closing Google Sheets?
How to Spell-check in Google Sheets
How to Trim Whitespaces in Google Sheets
You can repeat the same text string with this formula.
REPT Function in Google Sheets: Explained
You can learn about other Google Sheets formulas and tips that are not mentioned here on this page: LiveFlow‘s How to Guides
Are you learning this formula to visualize financial data, build a financial model, or conduct financial analysis? In that case, LiveFlow may help you automate manual workflows and update numbers in real-time. You can access various financial templates on our website, from the simple Income Statement to Multi-Currency Consolidated Financial Statement. You can also customize these templates as you want without breaking the automated data inflow.
To learn more about LiveFlow, book a demo.
Learn how to do this step-by-step in the video below 👇