To make things easier to understand, consider the following example. This example shows how you can find and extract all characters in a text string to the left or to the right of a specific character. Find a string preceding or following a given character Typically, you would utilize them in combination with other functions such as MID, LEFT or RIGHT, and the following formula examples demonstrate some real-life uses. In practice, the Excel FIND and SEARCH functions are rarely used on their own. To find an actual question mark (?) or asterisk (*), type a tilde (~) before the corresponding character. To see how it works on real data, consider the following example:Īs you see in the screenshot above, the formula SEARCH("function*2013", A2) returns the position of the first character ("f") in the substring if the text string referred to in the within_text argument contains both "function" and "2013", no matter how many other characters there are in between.
#Excel indexof series
#Excel indexof how to
Start_num is equal to or less than zero.įurther on in this tutorial, you will find a few more meaningful formula examples that demonstrate how to use SEARCH function in Excel worksheets.The start_num argument is greater than the length of within_text.The value of the find_text argument is not found.Like FIND, Excel's SEARCH function returns the #VALUE! error if: =SEARCH("e", "Excel") returns 1 because "e" is the first character in the word "Excel", ignoring the case. =SEARCH("market", "supermarket") returns 6 because the substring "market" begins at the 6 th character of the word "supermarket". Unlike FIND, the SEARCH function is case-insensitive and it allows using the wildcard characters, as demonstrated in the following example.Īnd here's a couple of basic Excel SEARCH formulas:
Is syntax and arguments are akin to those of FIND: The SEARCH function in Excel is very similar to FIND in that it also returns the location of a substring in a text string.
If you are looking for a case-insensitive match, use the SEARCH function. To correctly use a FIND formula in Excel, keep in mind the following simple facts: The formula =FIND("a", "find") returns an error because there is no "a" in " find".Įxcel FIND function - things to remember! If the FIND function does not find the find_text character(s), a #VALUE! error is returned.įor example, the formula =FIND("d", "find") returns 4 because "d" is the 4 th letter in the word " find". If omitted, the search starts from the 1 st character of the within_text string. Start_num - an optional argument that specifies from which character the search shall begin.Usually it's supplied as a cell reference, but you can also type the string directly in the formula. Within_text - the text string to be searched within.Find_text - the character or substring you want to find.The first 2 arguments are required, the last one is optional.