Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2016 for Mac Excel 2013 Excel 2010 Excel 2007 Excel for Mac 2011 Excel Starter 2010 More…Less
This article describes the formula syntax and usage of the FIND and FINDB functions in Microsoft Excel.
Description
FIND and FINDB locate one text string within a second text string, and return the number of the starting position of the first text string from the first character of the second text string.
Important:
-
These functions may not be available in all languages.
-
FIND is intended for use with languages that use the single-byte character set (SBCS), whereas FINDB is intended for use with languages that use the double-byte character set (DBCS). The default language setting on your computer affects the return value in the following way:
-
FIND always counts each character, whether single-byte or double-byte, as 1, no matter what the default language setting is.
-
FINDB counts each double-byte character as 2 when you have enabled the editing of a language that supports DBCS and then set it as the default language. Otherwise, FINDB counts each character as 1.
The languages that support DBCS include Japanese, Chinese (Simplified), Chinese (Traditional), and Korean.
Syntax
FIND(find_text, within_text, [start_num])
FINDB(find_text, within_text, [start_num])
The FIND and FINDB function syntax has the following arguments:
-
Find_text Required. The text you want to find.
-
Within_text Required. The text containing the text you want to find.
-
Start_num Optional. Specifies the character at which to start the search. The first character in within_text is character number 1. If you omit start_num, it is assumed to be 1.
Remarks
-
FIND and FINDB are case sensitive and don’t allow wildcard characters. If you don’t want to do a case sensitive search or use wildcard characters, you can use SEARCH and SEARCHB.
-
If find_text is «» (empty text), FIND matches the first character in the search string (that is, the character numbered start_num or 1).
-
Find_text cannot contain any wildcard characters.
-
If find_text does not appear in within_text, FIND and FINDB return the #VALUE! error value.
-
If start_num is not greater than zero, FIND and FINDB return the #VALUE! error value.
-
If start_num is greater than the length of within_text, FIND and FINDB return the #VALUE! error value.
-
Use start_num to skip a specified number of characters. Using FIND as an example, suppose you are working with the text string «AYF0093.YoungMensApparel». To find the number of the first «Y» in the descriptive part of the text string, set start_num equal to 8 so that the serial-number portion of the text is not searched. FIND begins with character 8, finds find_text at the next character, and returns the number 9. FIND always returns the number of characters from the start of within_text, counting the characters you skip if start_num is greater than 1.
Examples
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.
Data |
||
Miriam McGovern |
||
Formula |
Description |
Result |
=FIND(«M»,A2) |
Position of the first «M» in cell A2 |
1 |
=FIND(«m»,A2) |
Position of the first «M» in cell A2 |
6 |
=FIND(«M»,A2,3) |
Position of the first «M» in cell A2, starting with the third character |
8 |
Example 2
Data |
||
Ceramic Insulators #124-TD45-87 |
||
Copper Coils #12-671-6772 |
||
Variable Resistors #116010 |
||
Formula |
Description (Result) |
Result |
=MID(A2,1,FIND(» #»,A2,1)-1) |
Extracts text from position 1 to the position of «#» in cell A2 (Ceramic Insulators) |
Ceramic Insulators |
=MID(A3,1,FIND(» #»,A3,1)-1) |
Extracts text from position 1 to the position of «#» in cell A3 (Copper Coils) |
Copper Coils |
=MID(A4,1,FIND(» #»,A4,1)-1) |
Extracts text from position 1 to the position of «#» in cell A4 (Variable Resistors) |
Variable Resistors |
Need more help?
Want more options?
Explore subscription benefits, browse training courses, learn how to secure your device, and more.
Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.
Purpose
Get location substring in a string
Return value
A number representing the location of substring
Usage notes
The FIND function returns the position (as a number) of one text string inside another. If there is more than one occurrence of the search string, FIND returns the position of the first occurrence. When the text is not found, FIND returns a #VALUE error. Also note, when find_text is empty, FIND returns 1. FIND does not support wildcards, and is always case-sensitive. Use the SEARCH function to find the position of text without case-sensitivity and with wildcard support.
Basic Example
The FIND function is designed to look inside a text string for a specific substring. When FIND locates the substring, it returns a position of the substring in the text as a number. If the substring is not found, FIND returns a #VALUE error. For example:
=FIND("p","apple") // returns 2
=FIND("z","apple") // returns #VALUE!
Note that text values entered directly into FIND must be enclosed in double-quotes («»).
Case-sensitive
The FIND function always case-sensitive:
=FIND("a","Apple") // returns #VALUE!
=FIND("A","Apple") // returns 1
TRUE or FALSE result
To force a TRUE or FALSE result, nest the FIND function inside the ISNUMBER function. ISNUMBER returns TRUE for numeric values and FALSE for anything else. If FIND locates the substring, it returns the position as a number, and ISNUMBER returns TRUE:
=ISNUMBER(FIND("p","apple")) // returns TRUE
=ISNUMBER(FIND("z","apple")) // returns FALSE
If FIND doesn’t locate the substring, it returns an error, and ISNUMBER returns FALSE.
Start number
The FIND function has an optional argument called start_num, that controls where FIND should begin looking for a substring. To find the first match of «the» in any combination of upper or lowercase, you can omit start_num, which defaults to 1:
=FIND("x","20 x 30 x 50") // returns 4
To start searching at character 5, enter 4 for start_num:
=FIND("x","20 x 30 x 50",5) // returns 9
Wildcards
The FIND function does not support wildcards. See the SEARCH function.
If cell contains
To return a custom result with the SEARCH function, use the IF function like this:
=IF(ISNUMBER(FIND(substring,A1)), "Yes", "No")
Instead of returning TRUE or FALSE, the formula above will return «Yes» if substring is found and «No» if not.
Notes
- The FIND function returns the location of the first find_text in within_text.
- The location is returned as the number of characters from the start.
- Start_num is optional and defaults to 1.
- FIND returns 1 when find_text is empty.
- FIND returns #VALUE if find_text is not found.
- FIND is case-sensitive but does not support wildcards.
- Use the SEARCH function to find a substring with wildcards.
Содержание
- Use Excel built-in functions to find data in a table or a range of cells
- Summary
- Create the Sample Worksheet
- Term Definitions
- Functions
- LOOKUP()
- VLOOKUP()
- INDEX() and MATCH()
- OFFSET() and MATCH()
- FIND Function in Excel
- What is FIND Function in Excel?
- Syntax of the FIND Function of Excel
- How to use the FIND Function in Excel?
- Example #1–Find a Single Character Within a Text String
- Example #2–Count the Number of Times a Single Character Occurs in a Range
- Example #3–Count the Text Strings Ending With Certain Characters
- Example #4–Extract Certain Characters From Each Cell of a Range
- Relevance and Uses of the FIND Function of Excel
- The Key Points Related to the FIND Function of Excel
- Frequently Asked Questions
- FIND Function in Excel Video
- Recommended Articles
Use Excel built-in functions to find data in a table or a range of cells
Summary
This step-by-step article describes how to find data in a table (or range of cells) by using various built-in functions in Microsoft Excel. You can use different formulas to get the same result.
Create the Sample Worksheet
This article uses a sample worksheet to illustrate Excel built-in functions. Consider the example of referencing a name from column A and returning the age of that person from column C. To create this worksheet, enter the following data into a blank Excel worksheet.
You will type the value that you want to find into cell E2. You can type the formula in any blank cell in the same worksheet.
Term Definitions
This article uses the following terms to describe the Excel built-in functions:
The whole lookup table
The value to be found in the first column of Table_Array.
Lookup_Array
-or-
Lookup_Vector
The range of cells that contains possible lookup values.
The column number in Table_Array the matching value should be returned for.
3 (third column in Table_Array)
Result_Array
-or-
Result_Vector
A range that contains only one row or column. It must be the same size as Lookup_Array or Lookup_Vector.
A logical value (TRUE or FALSE). If TRUE or omitted, an approximate match is returned. If FALSE, it will look for an exact match.
This is the reference from which you want to base the offset. Top_Cell must refer to a cell or range of adjacent cells. Otherwise, OFFSET returns the #VALUE! error value.
This is the number of columns, to the left or right, that you want the upper-left cell of the result to refer to. For example, «5» as the Offset_Col argument specifies that the upper-left cell in the reference is five columns to the right of reference. Offset_Col can be positive (which means to the right of the starting reference) or negative (which means to the left of the starting reference).
Functions
LOOKUP()
The LOOKUP function finds a value in a single row or column and matches it with a value in the same position in a different row or column.
The following is an example of LOOKUP formula syntax:
The following formula finds Mary’s age in the sample worksheet:
The formula uses the value «Mary» in cell E2 and finds «Mary» in the lookup vector (column A). The formula then matches the value in the same row in the result vector (column C). Because «Mary» is in row 4, LOOKUP returns the value from row 4 in column C (22).
NOTE: The LOOKUP function requires that the table be sorted.
For more information about the LOOKUP function, click the following article number to view the article in the Microsoft Knowledge Base:
VLOOKUP()
The VLOOKUP or Vertical Lookup function is used when data is listed in columns. This function searches for a value in the left-most column and matches it with data in a specified column in the same row. You can use VLOOKUP to find data in a sorted or unsorted table. The following example uses a table with unsorted data.
The following is an example of VLOOKUP formula syntax:
The following formula finds Mary’s age in the sample worksheet:
The formula uses the value «Mary» in cell E2 and finds «Mary» in the left-most column (column A). The formula then matches the value in the same row in Column_Index. This example uses «3» as the Column_Index (column C). Because «Mary» is in row 4, VLOOKUP returns the value from row 4 in column C (22).
For more information about the VLOOKUP function, click the following article number to view the article in the Microsoft Knowledge Base:
INDEX() and MATCH()
You can use the INDEX and MATCH functions together to get the same results as using LOOKUP or VLOOKUP.
The following is an example of the syntax that combines INDEX and MATCH to produce the same results as LOOKUP and VLOOKUP in the previous examples:
The following formula finds Mary’s age in the sample worksheet:
The formula uses the value «Mary» in cell E2 and finds «Mary» in column A. It then matches the value in the same row in column C. Because «Mary» is in row 4, the formula returns the value from row 4 in column C (22).
NOTE: If none of the cells in Lookup_Array match Lookup_Value («Mary»), this formula will return #N/A.
For more information about the INDEX function, click the following article number to view the article in the Microsoft Knowledge Base:
OFFSET() and MATCH()
You can use the OFFSET and MATCH functions together to produce the same results as the functions in the previous example.
The following is an example of syntax that combines OFFSET and MATCH to produce the same results as LOOKUP and VLOOKUP:
This formula finds Mary’s age in the sample worksheet:
The formula uses the value «Mary» in cell E2 and finds «Mary» in column A. The formula then matches the value in the same row but two columns to the right (column C). Because «Mary» is in column A, the formula returns the value in row 4 in column C (22).
For more information about the OFFSET function, click the following article number to view the article in the Microsoft Knowledge Base:
Источник
FIND Function in Excel
What is FIND Function in Excel?
The FIND function of Excel searches and returns the position of a character within a text string. This position is returned as a numeric value, which represents the first instance of such character. The FIND function can also be informed the exact position from where the search should begin.
For example, the formula =FIND(“w”,“sunflower”) returns 7. This implies that the character “w” is at the seventh position of the text string “sunflower.”
The FIND function searches within the text string beginning from left to right. The purpose of using the FIND function is to ascertain whether a particular substring occurs in a specific cell or not. The FIND can also be used with other Excel functions Excel Functions Excel functions help the users to save time and maintain extensive worksheets. There are 100+ excel functions categorized as financial, logical, text, date and time, Lookup & Reference, Math, Statistical and Information functions. read more to extract certain characters of a text string.
The FIND function is categorized as a Text function of Excel.
Table of contents
Syntax of the FIND Function of Excel
The syntax of the FIND function of Excel is shown in the following image:
The FIND function of Excel accepts the following arguments:
- Find_text: This is the character (or substring) whose position is to be searched. It can be supplied as a reference to a cell containing the substring or as a direct substring enclosed within double quotation marks.
- Within_text: This is the text string within which the character (or substring) needs to be searched. It can be supplied either directly to the FIND function or as a reference to a cell containing the text string. Enclose the text string within double quotation marks when supplied directly to the function.
- Start_num: This is the character from which the search shall begin. It is supplied as a numeric value to the FIND function. For instance, if this argument is 3, the search begins from the third character of the “within_text” argument.
The arguments “find_text” and “within_text” are required, while “start_num” is optional. If the “start_num” argument is omitted, the search begins from the first character of the “within_text” argument.
How to use the FIND Function in Excel?
Let us consider some examples to understand the working of the FIND function in Excel.
Example #1–Find a Single Character Within a Text String
The following image shows a text string and substring in cells A3 and B3 respectively. Within the text string (leopard), we want to find the substring (a) by using the FIND function of Excel. Supply the “find_text” and “within_text” arguments as:
- Cell references
- Direct strings
Consider the “start_num” argument to be 1 in both cases.
Step 1: Supply the cell references of the substring and the text string (in the stated sequence) to the FIND function. So, enter the following formula in cell C3.
Notice that the “start_num” argument is omitted since it is 1.
Step 2: Press the “Enter” key. The output appears, as shown in the following image. Hence, the character “a” is the fifth letter of the word “leopard.”
b. The steps to use the FIND function with direct strings are listed as follows:
Step 1: Supply the substring and the text string (in the stated sequence) to the FIND function directly. So, enter the following formula in cell C4.
Since the “start_num” argument is 1, it has been omitted.
Step 2: Press the “Enter” key. The output in cell C4 is 5. This is shown in the following image. Hence, whether the first two arguments are entered as cell references or direct strings, the output of the FIND function is the same.
Example #2–Count the Number of Times a Single Character Occurs in a Range
The following image shows some random text strings in the range A3:A6. We want to find the number of times the character (or substring) “i” appears in this range. Use the FIND, ISNUMBER, and SUMPRODUCT functions of Excel.
The steps to find the character count by using the stated functions are listed as follows:
Step 1: Enter the following formula in cell B3.
Step 2: Press the “Enter” key. The output in cell B3 is 3. This is shown in the following image. Hence, the character “i” appears thrice in the range A3:A6.
- The FIND function looks for the character “i” in each cell of range A3:A6. This character is found in cells A3, A4, and A6. It is not found in cell A5. If the character “i” is found in a cell, the FIND function returns its position. However, if this character is not found in a cell, the FIND function returns the “#VALUE!” error. So, the FIND function returns an array of four values <3;5;#VALUE!;5 >.
- The array returned by the FIND function becomes an argument of the ISNUMBER function. If the output of the FIND function is numeric, the ISNUMBER returns “true.” However, if the output of the FIND function is an error, the ISNUMBER function returns “false.” So, the ISNUMBER returns an array of Boolean values .
- The unary operator or the double negative symbol (- -) converts every “true” and “false” output of the ISNUMBER function into 1 and 0 respectively. So, the unary operator returns a vertical array of four numbers <1;1;0;1>.
- The array (<1;1;0;1>) returned by the unary operator becomes an argument of the SUMPRODUCT function. Since it is a single array of numbers, the SUMPRODUCT sums it. So, the sum returned by the SUMPRODUCT function is 3.
Hence, the final output of the given formula (entered in step 1) is 3.
Notice that three cells of the range A3:A6 contained a single instance of the character “i.” However, had there been multiple occurrences of this character in cells A3, A4 or A6, the FIND function would have returned its first instance. Therefore, the final output would still have been 3.
Note 1: The ISNUMBER function checks whether a value (or a cell containing a value) is numeric or not. The SUMPRODUCT function multiplies the numbers of two or more arrays and sums up the resulting products. In case of a single array, the SUMPRODUCT function adds the numbers and returns their sum.
For the syntax of the ISNUMBER and SUMPRODUCT functions, click the hyperlinks given in the preceding explanation.
Like the FIND function, the COUNTIF would also have returned 3 in case of multiple occurrences of character “i” in cells A3, A4 or A6. However, the COUNTIF is not case-sensitive, unlike the FIND function.
Example #3–Count the Text Strings Ending With Certain Characters
The following image shows a list of names in column A. We want to find the number of names ending with “ansh” or “anka” in the range A3:A10. Use the FIND, ISNUMBER, and SUMPRODUCT functions of Excel.
The steps to count specific names by using the stated functions are listed as follows:
Step 1: Enter the following formula in cell B3.
Step 2: Press the “Enter” key. The output in cell B3 is 4. This is shown in the following image.
Hence, a total of 4 names end with “ansh” or “anka.” Two names end with the former substring (Priyansh and Divyansh) and two names end with the latter substring (Priyanka and Divyanka).
Explanation: The formula entered in step 1 is explained as follows:
- The FIND function processes each name of the range A3:A10. If “ansh” or “anka” are present in a cell, the FIND function returns the position of the first letter of these substrings. However, if these substrings are not present in a cell, the FIND function returns the “#VALUE!” error. So, the FIND function returns two arrays <#VALUE!;#VALUE!;5;5;#VALUE!;#VALUE!;#VALUE!; #VALUE!>and <5;5;#VALUE!;#VALUE!;#VALUE!;#VALUE!;#VALUE!;#VALUE!>.
- The ISNUMBER processes the outputs returned by the FIND function. If the output of the FIND function is numeric, the ISNUMBER returns “true,” otherwise returns “false.” So, the ISNUMBER function returns two arrays and .
- The two arrays returned by the ISNUMBER function are added due to the “plus” operator placed between them. The array returned after addition and the application of the “greater than zero” expression is .
- The unary operator (- -) converts each “true” and “false” output of the preceding array to 1 and 0 respectively. So, the unary operator returns the final array of 8 values <1;1;1;1;0;0;0;0>.
- The SUMPRODUCT function sums the single array returned by the unary operator. Hence, this function returns the output 4.
Note 1: The “greater than zero” expression checks whether each output of the two arrays (returned by the ISNUMBER function) is greater than zero or not. This expression is useful in case one requires logical values (true and false) as the output.
This expression returns “true” if either of the two outputs (of the two arrays returned by the ISNUMBER function) is a number. It returns “false” if both outputs are errors.
Note 2: For knowing more about the ISNUMBER and SUMPRODUCT functions, refer to the hyperlinks (within the explanation) or “note 1” of the preceding example (example #2).
The following image shows some incomplete statements containing a hash symbol (#) in column C. From each statement, we want to extract this symbol, the word following it, and the trailing space in a separate column. Use the MID and FIND functions of Excel.
The steps to extract the given substrings using the stated functions are listed as follows:
Step 1: Enter the following formula in cell D3.
Step 2: Press the “Enter” key. The output in cell D3 is “#Wedding .” It includes a space at the end. The output is shown in the following image.
Step 3: Drag the formula of cell D3 till cell D5 by using the fill handle. The output of the range D3 to D5 is shown in the following image.
Hence, the hash symbol, the following word, and the trailing space have been extracted from each statement of column C.
Explanation: In the given formula (entered in step 1), each function on the right is processed, followed by the subsequent function on the left. The LEN function LEN Function The Len function returns the length of a given string. It calculates the number of characters in a given string as input. It is a text function in Excel as well as an inbuilt function that can be accessed by typing =LEN( and entering a string as input. read more , being the innermost (or rightmost), is processed first. The entire formula works as follows:
- The LEN function counts the total number of characters in cell C3. So, the formula “=LEN(C3)” returns 27. This count includes 23 letters, 3 spaces, and 1 hash symbol.
- Next, the FIND function searches the position of the hash symbol in cell C3. So, the formula “=FIND(“#”,C3)” returns 10. This implies that the hash symbol is at the tenth position of the statement given in cell C3.
- The outputs of the FIND and LEN functions become the arguments of the MID functionMID FunctionThe mid function in Excel is a text function that finds strings and returns them from any mid-part of the spreadsheet.read more . So, the MID function processes the formula “=MID(C3,10,27)” and returns “#Wedding in Jaipur.”
- The output of the MID function becomes the argument of the FIND function. The FIND function searches for a space character in the string “#Wedding in Jaipur.” So, the formula “=FIND(“ ”,“#Wedding in Jaipur”) returns 9. This implies that the first instance of the space character is at the ninth position of the given text string (#Wedding in Jaipur).
- The formula “=FIND(“#”,C3)” again returns 10.
- The outputs of the two FIND functions (in the preceding two pointers) become the arguments of the MID function. The formula “=MID(C3,10,9)” returns the string beginning from the tenth character and consisting of nine characters in total. So, this formula returns “#Wedding ” including a single space at the end of the word.
Likewise, the outputs in cells D4 and D5 have been returned by Excel.
Note 1: The LEN function counts all the characters in a cell. This includes letters, numbers, spaces, and special characters. The MID function helps extract a certain number of characters from the middle of the string. The position to begin extraction from can be specified to the MID function.
For the syntax of the LEN and MID functions, click the hyperlinks given in the preceding explanation.
Note 2: In the formula “=MID(C3,10,27),” the “start_num” argument is 10 and the “num_chars” argument is 27. If the sum of these two arguments exceeds the total length of the string, the MID function returns the characters beginning from the “start_num” till the end of the entire string.
Therefore, since 37 (“start_num” is 10 and “num_chars” is 27) exceeds 27 (length of the entire string), the MID function returns the character beginning from the tenth place (#) till the end of the string (Jaipur). So, the MID function returns “#Wedding in Jaipur.”
Relevance and Uses of the FIND Function of Excel
The FIND function of Excel is helpful in the following situations:
- It helps extract the relevant characters, thereby removing the unwanted substrings of a text string.
- It helps extract the words preceding or succeeding a specific character.
- It assists in searching the n th occurrence of a character.
- It can be combined with other functions of Excel to find the number of times a character appears in a range.
The important points related to the FIND function of Excel are listed as follows:
- The FIND function looks for the first occurrence of the “find_text” in the “within_text” argument.
- The “find_text” and “within_text” arguments can be supplied as cell references or direct text strings. To supply these arguments as direct text strings, they must be enclosed within double quotation marks.
- If the “find_text” argument contains more than one character, the FIND function returns the position of the first character in the “within_text” argument.
- If the “find_text” argument is an empty string (“”), the FIND function returns 1.
- The FIND function is case-sensitive and does not support the usage of wildcard characters.
- The FIND function returns the “#VALUE!” error in the following cases:
- The “find_text” is not found in the “within_text” argument
- The “start_num” argument is zero or negative
- The “start_num” argument contains more characters than the “within_text” argument
Frequently Asked Questions
The FIND function of Excel returns the position of a character within a text string. The first instance of such character is returned. In case multiple characters are searched within a text string, the position of the first searched character is returned.
The FIND function of Excel returns a numeric value. The function can be told the position from where the search should begin.
Note: For the syntax of the FIND function of Excel, refer to the heading “syntax of the FIND function of Excel” of this article.
Yes, the FIND function of Excel is case-sensitive. This implies that this function treats the lowercase and uppercase letters differently.
For example, the formula =FIND(“m”,“smile”) looks for the lowercase “m” in the text string “smile.” It returns 2, signifying that “m” is the second letter of the given text string.
However, the formula =FIND(“M”,“smile”) looks for the uppercase “M” in the text string “smile.” It returns the “#VALUE!” error since “M” could not be found in the given text string. Had the text string been supplied as “SMILE,” the FIND function would have again returned 2.
Note: For a case-insensitive function, use the SEARCH in place of the FIND function of Excel.
The LEFT function helps extract the specified number of characters from the leftmost side of a text string. The FIND and LEFT functions can be used together to extract a substring from the left side of a cell. The formula for the same is stated as follows:
The “textstring” is the cell reference containing the entire text string. The substring preceding the “character” is extracted. The “-1” ensures that the “character” is not included in the output.
Therefore, if the substring “rose” needs to be extracted from cell A1 containing “rose flower,” the formula used is “=LEFT(A1,FIND(” “,A1)-1).” The “-1” of the formula helps exclude the trailing space of the substring extracted. Had the strings “rose” and “flower” been separated by a hyphen, we would have used the hyphen (“-”) as the “character.”
Note: The given formula should be entered in Excel without the beginning and ending double quotation marks.
FIND Function in Excel Video
Recommended Articles
This has been a guide to the FIND function in Excel. Here we discuss how to use FIND Formula in excel along step by step examples. You may also look at these useful functions in Excel–
Источник
The FIND function of Excel searches and returns the position of a character within a text string. This position is returned as a numeric value, which represents the first instance of such character. The FIND function can also be informed the exact position from where the search should begin.
For example, the formula =FIND(“w”,“sunflower”) returns 7. This implies that the character “w” is at the seventh position of the text string “sunflower.”
The FIND function searches within the text string beginning from left to right. The purpose of using the FIND function is to ascertain whether a particular substring occurs in a specific cell or not. The FIND can also be used with other Excel functionsExcel functions help the users to save time and maintain extensive worksheets. There are 100+ excel functions categorized as financial, logical, text, date and time, Lookup & Reference, Math, Statistical and Information functions.read more to extract certain characters of a text string.
The FIND function is categorized as a Text function of Excel.
Table of contents
- What is FIND Function in Excel?
- Syntax of the FIND Function of Excel
- How to use the FIND Function in Excel?
- Example #1–Find a Single Character Within a Text String
- Example #2–Count the Number of Times a Single Character Occurs in a Range
- Example #3–Count the Text Strings Ending With Certain Characters
- Example #4–Extract Certain Characters From Each Cell of a Range
- Relevance and Uses of the FIND Function of Excel
- The Key Points Related to the FIND Function of Excel
- Frequently Asked Questions
- FIND Function in Excel Video
- Recommended Articles
Syntax of the FIND Function of Excel
The syntax of the FIND function of Excel is shown in the following image:
The FIND function of Excel accepts the following arguments:
- Find_text: This is the character (or substring) whose position is to be searched. It can be supplied as a reference to a cell containing the substring or as a direct substring enclosed within double quotation marks.
- Within_text: This is the text string within which the character (or substring) needs to be searched. It can be supplied either directly to the FIND function or as a reference to a cell containing the text string. Enclose the text string within double quotation marks when supplied directly to the function.
- Start_num: This is the character from which the search shall begin. It is supplied as a numeric value to the FIND function. For instance, if this argument is 3, the search begins from the third character of the “within_text” argument.
The arguments “find_text” and “within_text” are required, while “start_num” is optional. If the “start_num” argument is omitted, the search begins from the first character of the “within_text” argument.
How to use the FIND Function in Excel?
Let us consider some examples to understand the working of the FIND function in Excel.
You can download this FIND Function Excel Template here – FIND Function Excel Template
Example #1–Find a Single Character Within a Text String
The following image shows a text string and substring in cells A3 and B3 respectively. Within the text string (leopard), we want to find the substring (a) by using the FIND function of Excel. Supply the “find_text” and “within_text” arguments as:
- Cell references
- Direct strings
Consider the “start_num” argument to be 1 in both cases.
a. The steps to use the FIND function with cell referencesCell reference in excel is referring the other cells to a cell to use its values or properties. For instance, if we have data in cell A2 and want to use that in cell A1, use =A2 in cell A1, and this will copy the A2 value in A1.read more are listed as follows:
Step 1: Supply the cell references of the substring and the text string (in the stated sequence) to the FIND function. So, enter the following formula in cell C3.
“=FIND(B3,A3)”
Notice that the “start_num” argument is omitted since it is 1.
Step 2: Press the “Enter” key. The output appears, as shown in the following image. Hence, the character “a” is the fifth letter of the word “leopard.”
b. The steps to use the FIND function with direct strings are listed as follows:
Step 1: Supply the substring and the text string (in the stated sequence) to the FIND function directly. So, enter the following formula in cell C4.
“=FIND(“a”, “Leopard”)”
Since the “start_num” argument is 1, it has been omitted.
Step 2: Press the “Enter” key. The output in cell C4 is 5. This is shown in the following image. Hence, whether the first two arguments are entered as cell references or direct strings, the output of the FIND function is the same.
Example #2–Count the Number of Times a Single Character Occurs in a Range
The following image shows some random text strings in the range A3:A6. We want to find the number of times the character (or substring) “i” appears in this range. Use the FIND, ISNUMBER, and SUMPRODUCT functions of Excel.
The steps to find the character count by using the stated functions are listed as follows:
Step 1: Enter the following formula in cell B3.
“=SUMPRODUCT(- -(ISNUMBER(FIND(“i”,A3:A6))))”
Step 2: Press the “Enter” key. The output in cell B3 is 3. This is shown in the following image. Hence, the character “i” appears thrice in the range A3:A6.
Explanation: In the formula entered in step 1, the FIND function is processed first as it is the innermost function. Next, the ISNUMBERISNUMBER function in excel is an information function that checks if the referred cell value is numeric or non-numeric.read more and SUMPRODUCTThe SUMPRODUCT excel function multiplies the numbers of two or more arrays and sums up the resulting products.read more functions are processed. The entire formula works as follows:
- The FIND function looks for the character “i” in each cell of range A3:A6. This character is found in cells A3, A4, and A6. It is not found in cell A5. If the character “i” is found in a cell, the FIND function returns its position. However, if this character is not found in a cell, the FIND function returns the “#VALUE!” error. So, the FIND function returns an array of four values {3;5;#VALUE!;5 }.
- The array returned by the FIND function becomes an argument of the ISNUMBER function. If the output of the FIND function is numeric, the ISNUMBER returns “true.” However, if the output of the FIND function is an error, the ISNUMBER function returns “false.” So, the ISNUMBER returns an array of Boolean values {TRUE;TRUE;FALSE;TRUE}.
- The unary operator or the double negative symbol (- -) converts every “true” and “false” output of the ISNUMBER function into 1 and 0 respectively. So, the unary operator returns a vertical array of four numbers {1;1;0;1}.
- The array ({1;1;0;1}) returned by the unary operator becomes an argument of the SUMPRODUCT function. Since it is a single array of numbers, the SUMPRODUCT sums it. So, the sum returned by the SUMPRODUCT function is 3.
Hence, the final output of the given formula (entered in step 1) is 3.
Notice that three cells of the range A3:A6 contained a single instance of the character “i.” However, had there been multiple occurrences of this character in cells A3, A4 or A6, the FIND function would have returned its first instance. Therefore, the final output would still have been 3.
Note 1: The ISNUMBER function checks whether a value (or a cell containing a value) is numeric or not. The SUMPRODUCT function multiplies the numbers of two or more arrays and sums up the resulting products. In case of a single array, the SUMPRODUCT function adds the numbers and returns their sum.
For the syntax of the ISNUMBER and SUMPRODUCT functions, click the hyperlinks given in the preceding explanation.
Note 2: Rather than the FIND function, one could have used the COUNTIFThe COUNTIF function in Excel counts the number of cells within a range based on pre-defined criteria. It is used to count cells that include dates, numbers, or text. For example, COUNTIF(A1:A10,”Trump”) will count the number of cells within the range A1:A10 that contain the text “Trump”
read more function. The formula for counting the character “i” in the range A3:A6 would be =COUNTIF(A3:A6,“*i*”). This formula would also have returned the output 3.
Like the FIND function, the COUNTIF would also have returned 3 in case of multiple occurrences of character “i” in cells A3, A4 or A6. However, the COUNTIF is not case-sensitive, unlike the FIND function.
Example #3–Count the Text Strings Ending With Certain Characters
The following image shows a list of names in column A. We want to find the number of names ending with “ansh” or “anka” in the range A3:A10. Use the FIND, ISNUMBER, and SUMPRODUCT functions of Excel.
The steps to count specific names by using the stated functions are listed as follows:
Step 1: Enter the following formula in cell B3.
“=SUMPRODUCT(- -((ISNUMBER(FIND(“ansh”,A3:A10))+ISNUMBER(FIND(“anka”,A3:A10)))>0))
Step 2: Press the “Enter” key. The output in cell B3 is 4. This is shown in the following image.
Hence, a total of 4 names end with “ansh” or “anka.” Two names end with the former substring (Priyansh and Divyansh) and two names end with the latter substring (Priyanka and Divyanka).
Explanation: The formula entered in step 1 is explained as follows:
- The FIND function processes each name of the range A3:A10. If “ansh” or “anka” are present in a cell, the FIND function returns the position of the first letter of these substrings. However, if these substrings are not present in a cell, the FIND function returns the “#VALUE!” error. So, the FIND function returns two arrays {#VALUE!;#VALUE!;5;5;#VALUE!;#VALUE!;#VALUE!; #VALUE!} and {5;5;#VALUE!;#VALUE!;#VALUE!;#VALUE!;#VALUE!;#VALUE!}.
- The ISNUMBER processes the outputs returned by the FIND function. If the output of the FIND function is numeric, the ISNUMBER returns “true,” otherwise returns “false.” So, the ISNUMBER function returns two arrays {FALSE;FALSE;TRUE;TRUE;FALSE;FALSE;FALSE;FALSE} and {TRUE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE}.
- The two arrays returned by the ISNUMBER function are added due to the “plus” operator placed between them. The array returned after addition and the application of the “greater than zero” expression is {TRUE;TRUE;TRUE;TRUE;FALSE;FALSE;FALSE;FALSE}.
- The unary operator (- -) converts each “true” and “false” output of the preceding array to 1 and 0 respectively. So, the unary operator returns the final array of 8 values {1;1;1;1;0;0;0;0}.
- The SUMPRODUCT function sums the single array returned by the unary operator. Hence, this function returns the output 4.
Note 1: The “greater than zero” expression checks whether each output of the two arrays (returned by the ISNUMBER function) is greater than zero or not. This expression is useful in case one requires logical values (true and false) as the output.
This expression returns “true” if either of the two outputs (of the two arrays returned by the ISNUMBER function) is a number. It returns “false” if both outputs are errors.
Note 2: For knowing more about the ISNUMBER and SUMPRODUCT functions, refer to the hyperlinks (within the explanation) or “note 1” of the preceding example (example #2).
The following image shows some incomplete statements containing a hash symbol (#) in column C. From each statement, we want to extract this symbol, the word following it, and the trailing space in a separate column. Use the MID and FIND functions of Excel.
The steps to extract the given substrings using the stated functions are listed as follows:
Step 1: Enter the following formula in cell D3.
“=MID(C3,FIND(“#”,C3),FIND(” “,(MID(C3,FIND(“#”,C3),LEN(C3)))))”
Step 2: Press the “Enter” key. The output in cell D3 is “#Wedding .” It includes a space at the end. The output is shown in the following image.
Step 3: Drag the formula of cell D3 till cell D5 by using the fill handle. The output of the range D3 to D5 is shown in the following image.
Hence, the hash symbol, the following word, and the trailing space have been extracted from each statement of column C.
Explanation: In the given formula (entered in step 1), each function on the right is processed, followed by the subsequent function on the left. The LEN functionThe Len function returns the length of a given string. It calculates the number of characters in a given string as input. It is a text function in Excel as well as an inbuilt function that can be accessed by typing =LEN( and entering a string as input.read more, being the innermost (or rightmost), is processed first. The entire formula works as follows:
- The LEN function counts the total number of characters in cell C3. So, the formula “=LEN(C3)” returns 27. This count includes 23 letters, 3 spaces, and 1 hash symbol.
- Next, the FIND function searches the position of the hash symbol in cell C3. So, the formula “=FIND(“#”,C3)” returns 10. This implies that the hash symbol is at the tenth position of the statement given in cell C3.
- The outputs of the FIND and LEN functions become the arguments of the MID functionThe mid function in Excel is a text function that finds strings and returns them from any mid-part of the spreadsheet. read more. So, the MID function processes the formula “=MID(C3,10,27)” and returns “#Wedding in Jaipur.”
- The output of the MID function becomes the argument of the FIND function. The FIND function searches for a space character in the string “#Wedding in Jaipur.” So, the formula “=FIND(“ ”,“#Wedding in Jaipur”) returns 9. This implies that the first instance of the space character is at the ninth position of the given text string (#Wedding in Jaipur).
- The formula “=FIND(“#”,C3)” again returns 10.
- The outputs of the two FIND functions (in the preceding two pointers) become the arguments of the MID function. The formula “=MID(C3,10,9)” returns the string beginning from the tenth character and consisting of nine characters in total. So, this formula returns “#Wedding ” including a single space at the end of the word.
Likewise, the outputs in cells D4 and D5 have been returned by Excel.
Note 1: The LEN function counts all the characters in a cell. This includes letters, numbers, spaces, and special characters. The MID function helps extract a certain number of characters from the middle of the string. The position to begin extraction from can be specified to the MID function.
For the syntax of the LEN and MID functions, click the hyperlinks given in the preceding explanation.
Note 2: In the formula “=MID(C3,10,27),” the “start_num” argument is 10 and the “num_chars” argument is 27. If the sum of these two arguments exceeds the total length of the string, the MID function returns the characters beginning from the “start_num” till the end of the entire string.
Therefore, since 37 (“start_num” is 10 and “num_chars” is 27) exceeds 27 (length of the entire string), the MID function returns the character beginning from the tenth place (#) till the end of the string (Jaipur). So, the MID function returns “#Wedding in Jaipur.”
Relevance and Uses of the FIND Function of Excel
The FIND function of Excel is helpful in the following situations:
- It helps extract the relevant characters, thereby removing the unwanted substrings of a text string.
- It helps extract the words preceding or succeeding a specific character.
- It assists in searching the nth occurrence of a character.
- It can be combined with other functions of Excel to find the number of times a character appears in a range.
The important points related to the FIND function of Excel are listed as follows:
- The FIND function looks for the first occurrence of the “find_text” in the “within_text” argument.
- The “find_text” and “within_text” arguments can be supplied as cell references or direct text strings. To supply these arguments as direct text strings, they must be enclosed within double quotation marks.
- If the “find_text” argument contains more than one character, the FIND function returns the position of the first character in the “within_text” argument.
- If the “find_text” argument is an empty string (“”), the FIND function returns 1.
- The FIND function is case-sensitive and does not support the usage of wildcard characters.
- The FIND function returns the “#VALUE!” error in the following cases:
- The “find_text” is not found in the “within_text” argument
- The “start_num” argument is zero or negative
- The “start_num” argument contains more characters than the “within_text” argument
Frequently Asked Questions
1. Define the FIND function of Excel.
The FIND function of Excel returns the position of a character within a text string. The first instance of such character is returned. In case multiple characters are searched within a text string, the position of the first searched character is returned.
The FIND function of Excel returns a numeric value. The function can be told the position from where the search should begin.
Note: For the syntax of the FIND function of Excel, refer to the heading “syntax of the FIND function of Excel” of this article.
2. Is the FIND function of Excel case-sensitive? Explain with the help of an example.
Yes, the FIND function of Excel is case-sensitive. This implies that this function treats the lowercase and uppercase letters differently.
For example, the formula =FIND(“m”,“smile”) looks for the lowercase “m” in the text string “smile.” It returns 2, signifying that “m” is the second letter of the given text string.
However, the formula =FIND(“M”,“smile”) looks for the uppercase “M” in the text string “smile.” It returns the “#VALUE!” error since “M” could not be found in the given text string. Had the text string been supplied as “SMILE,” the FIND function would have again returned 2.
Note: For a case-insensitive function, use the SEARCH in place of the FIND function of Excel.
3. How can the FIND function be used with the LEFT function of Excel?
The LEFT function helps extract the specified number of characters from the leftmost side of a text string. The FIND and LEFT functions can be used together to extract a substring from the left side of a cell. The formula for the same is stated as follows:
“=LEFT(textstring,FIND(character,textstring)-1)”
The “textstring” is the cell reference containing the entire text string. The substring preceding the “character” is extracted. The “-1” ensures that the “character” is not included in the output.
Therefore, if the substring “rose” needs to be extracted from cell A1 containing “rose flower,” the formula used is “=LEFT(A1,FIND(” “,A1)-1).” The “-1” of the formula helps exclude the trailing space of the substring extracted. Had the strings “rose” and “flower” been separated by a hyphen, we would have used the hyphen (“-”) as the “character.”
Note: The given formula should be entered in Excel without the beginning and ending double quotation marks.
FIND Function in Excel Video
Recommended Articles
This has been a guide to the FIND function in Excel. Here we discuss how to use FIND Formula in excel along step by step examples. You may also look at these useful functions in Excel–
- Excel Find and SelectFind and Select in Excel is a feature available on the Home Tab of Excel that facilitates the user to quickly discover a specific text or value in the given data. The shortcut key to instantly use this feature is Ctrl+F.read more
- VBA FIND FunctionVBA Find gives the exact match of the argument. It takes three arguments, one is what to find, where to find and where to look at. If any parameter is missing, it takes existing value as that parameter.read more
- Row Function in ExcelThe row function in Excel is a worksheet function that displays the current row index number of the selected or target cell. The syntax to use this function is as follows: =ROW( Value ).read more
- VLOOKUP Excel FunctionThe VLOOKUP excel function searches for a particular value and returns a corresponding match based on a unique identifier. A unique identifier is uniquely associated with all the records of the database. For instance, employee ID, student roll number, customer contact number, seller email address, etc., are unique identifiers.
read more
The two formulas FIND and SEARCH in Excel are very similar. They search through a cell or some text for a keyword or character. Once found, they return the number of characters, at which the keyword starts. Let’s learn how to use them and explore the differences of the two formulas.
How to use the FIND formula
The formula returns the number of the character, at which your search term starts. If your text can’t be found, it’ll return a “#VALUE” error.
Structure of the FIND formula
The structure of the FIND formula is quite simple (the numbers are corresponding to the image on the right-hand side):
- SEARCH TERM: The first part of the formula is the text you look for.
- WITHIN TEXT: The cell or text you want to search your “SEARCH TERM” in.
- START NUMBER: This argument is optional. If you don’t want to start searching at the beginning of the text, fill in the number larger than 1, otherwise just type 1 or leave it blank.
If you just want to know, if your text can be found within another cell, you might want to go with the following formula. B2 contains the text or character you search for and B3 is the cell you search in:
=IFERROR(IF(FIND(B2,B3)>0,”Value found”,””),”Value not found”)
Please note the following comments:
- FIND is case-sensitive. That means, it matters if you use small or capital letters.
- You can also search for numbers within another number. For example: =FIND(1,321)This formula returns 3 because the number 1 is the third character of 321.
- You can’t use wildcard criteria (“*” or “?”) with the FIND formula.
- Please refer to this article if you want to know more about the IF formula and to this article for more information about the IFERROR formula.
Examples for the FIND formula
Let’s try some examples.
Example 1: Find the first occurrence
The “default” usage of the FIND formula is to return the number of characters, at which a text first occurs within another text. Let’s say you have the text “Hello there” and want to know, at which position you have an “o”. In such case, you write the following formula (example number 1 in the Excel workbook you can download at the end of this article).
=FIND(“o”,”Hello there”)
The return value is 5.
Example 2: Find the first occurrence after the third character
Another example: You want to know the position of “e” after the third character (example number 2 in the example workbook).
=FIND(“e”,”Hello there”,3)
The return value is 9.
Example 3: Find the second occurrence
Now you want to know the position of the second occurrence of “e” in “Hello there”.
=FIND(“e”;”Hello there”;FIND(“e”;”Hello there”)+1)
This formula works as follows. The second FIND formula returns the position of the first occurrence of “e” in “Hello there” which is 2. This is used as the START NUMBER (+ 1 because you want to start counting after the first “e”) for the first FIND formula.
Example 4: Find the last occurrence
Finding the last occurrence of a string within a text is a little bit more complicated. You use SUBSTITUTE and LEN. The complete formula is like this:
=FIND(“tempreplacetext”;SUBSTITUTE(“Hello there”;”e”;”tempreplacetext”;SUM(LEN(“Hello there”)-LEN(SUBSTITUTE(“Hello there”;”e”;””)))/LEN(“e”)))
In order to understand the formula better, let’s start in the middle with the part SUM(LEN(“Hello there”)-LEN(SUBSTITUTE(“Hello there”;”e”;””)))/LEN(“e”)))
This part of the formula determines the number of “e” in “Hello there”. It replaces “e” in “Hello there” and the difference in the two versions (with and without e – “Hello there” and “Hllo thr”) is the number of “e”s.
The whole part SUBSTITUTE(“Hello there”;”e”;”tempreplacetext”;SUM(LEN(“Hello there”)-LEN(SUBSTITUTE(“Hello there”;”e”;””)))/LEN(“e”))) replaces the last “e” by “tempreplacetext”. Now you just put this into the FIND formula and get the position of “tempreplacetext”.
If you want to use this formula, replace all “e”s by your cell reference for the SEARCH TEXT and all “Hello there” by the cell reference to your WITHIN TEXT.
Replace text enclosed by brackets
A last example for the FIND formula: You want to know what is written between two brackets. In such case, you can also use the FIND formulas in combination with the MID formula.
=MID(“Hello (you) there”,FIND(“(“,”Hello (you) there”)+1,FIND(“)”,”Hello (you) there”)-FIND(“(“,”Hello (you) there”)-1)
The MID formula returns some part of text from a (longer) text. It has three arguments:
- The initial, complete text.
- The starting character for the text you want to get.
- The length (in number of characters) of text you want to extract.
In our example above, the first FIND formula provides the character you want to start at. In our case that’s the first opening bracket (+1 because you want to start one character later). The second and third FIND formulas determine the length by
How to use the SEARCH formula
Like the FIND formula in Excel, SEARCH also returns the position of a text within another text.
Structure of the SEARCH formula
The SEARCH formula is very similar to the FIND formula. It has exactly the same arguments and works the same way.
Because of the, the structure is as follows:
- The SEARCH TERM is the text or character you search for.
- WITHIN TEXT contains the text you search in.
- The START NUMBER is optional and defines the number of character, after which Excel should start searching.
Yes, you are right – these arguments are exactly the same like in the FIND formula. But there is a major difference: SEARCH does not regard lower and upper case: It is not case sensitive. FIND on the other hand is case-sensitive and regards upper and lower cases.
Do you want to boost your productivity in Excel?
Get the Professor Excel ribbon!
Add more than 120 great features to Excel!
Examples for the SEARCH formula
The examples work exactly the same way like for the FIND formula. You only have to replace “FIND” by “SEARCH”. Because of that, we just show the summary below. If you want to know more, either scroll up to the “FIND”-examples or download the example workbook below.
Example no. | Description | Formula |
6 | Return the position of “o” in “Hello there”. | =SEARCH(“o”,”Hello there”) |
7 | Return the position of “e” in “Hello there” after the third character. | =SEARCH(“e”,”Hello there”,3) |
8 | Return the position of the second occurrence of “e” in “Hello there”. | =SEARCH(“e”,”Hello there”,SEARCH(“e”,”Hello there”)+1) |
9 | Return the position of the last occurrence of “e” in “Hello there”. | =SEARCH(“tempreplacetext”,SUBSTITUTE(“Hello there”,”e”,”tempreplacetext”,SUM(LEN(“Hello there”)-LEN(SUBSTITUTE(“Hello there”,”e”,””)))/LEN(“e”))) |
10 | Return the text within brackets of “Hello (you) there”. | =MID(“Hello (you) there”,SEARCH(“(“,”Hello (you) there”)+1,SEARCH(“)”,”Hello (you) there”)-SEARCH(“(“,”Hello (you) there”)-1) |
Troubleshooting
The error message “#VALUE!” comes up most often for the FIND and SEARCH formulas. If you receive a “#VALUE!” error, please check the following possibilities.
- Make sure your SEARCH TERM can be found. If it can’t be found, you’ll receive the #VALUE! error.
- The last argument, the START NUMBER, is larger than the number of characters of in your WITHIN TEXT argument.
- You haven’t provided the last argument although you wrote the comma. For instance =SEARCH(“b”,”abc”,).
- Please check, if your SEARCH TERM and WITHIN TEXT have the same format. You can’t search for a letter or text in a number cell.
Difference between FIND and SEARCH
The first and major difference between FIND and SEARCH:
FIND is case-sensitive. SEARCH is not case-sensitive.
That means, FIND regards capital and small letter whereas SEARCH doesn’t.
How to remember which is which? I use the mnemonic:
- FIND finds exactly what you look for.
- Searching for something also searches for roughly what you look for.
I admit, it’s not the best mnemonic. Please let me know, if you have a better one!
There is also a second difference between FIND and SEARCH: You can use SEARCH with wildcard criteria within the SEARCH TERM.
- “?” stands for a single character. Example: =SEARCH(“?b”,”abc”)
- “*” matches any sequence of characters. =SEARCH(“*b”,”abc”)
- If you want to search exactly for ? or *, write a tilde in front of them. Example: =SEARCH(“~*”,”ab*c”)
Differences between FIND and FINDB as well as SEARCH and SEARCHB
Maybe you have noticed that there is also a slightly different version of the two formulas in Excel. If you add a “B” to the formulas, you can still use them the same way. So what is the difference?
FINDB and SEARCHB provide support for more complex languages. The definition by Microsoft is:
SEARCHB counts 2 bytes per character only when a DBCS language is set as the default language. Otherwise SEARCHB behaves the same as SEARCH, counting 1 byte per character.
According to Wikipedia DBCS stands mainly for the Asian languages Chinese, Japanese and Korean.
Please feel free to download all the examples shown above in this Excel file.
Click here and the download starts immediately.
A few days back I had a huge spreadsheet in which I had to find out the cells containing formulas. Initially, I was totally clueless about how this task can be done.
But later after doing some Google searches, I got a few ideas on how I can effortlessly identify the formula cells in excel.
And today to share my experiences with you guys, In this post I will throw some light on a few methods that can help you to find out formula cells in your spreadsheets.
So here we go:
Method 1: Using ‘Go To Special’ Option:
In Excel ‘Go To Special’ is a very handy option when it comes to finding the cells with formulas. ‘Go to Special’ option has a radio button “Formulas” and selecting this radio button enables it to select all the cells containing formulas.
Later you can change the formatting or background color of the selected cells to make them stand out from the rest. Below is the step by step instructions for accomplishing this:
1. With your excel sheet opened navigate to the ‘Home’ tab > ‘Find & Select’ > ‘Go To Special’. Alternatively, you can also press ‘F5’ and then ‘Alt + S’ to open the ‘Go to Special’ dialog.
2. Next, in the ‘Go to Special’ window select the ‘Formulas’ radio button. After checking this radio button you will notice that few checkboxes (like Numbers, Errors, Logical, and Text) are enabled, these checkboxes signify the return type of the formulas.
So, if you select the ‘Formulas’ radio button and only check the ‘Numbers’ checkbox then it will just search the Formulas whose return type is a number. Here in our example, we will keep all of these return types checked.
3. After this click the ‘Ok’ button and all the cells that contain formulas get selected.
4. Next, without clicking anywhere on your spreadsheet change the background color of all the selected cells.
5. Now your formula cells can be easily identified.
Method 2: Using a built-in Excel formula
If you have worked with excel formulas then probably you may be knowing that excel has a formula that can find whether a cell contains a formula or not. The formula that I am talking about is:
=ISFORMULA(reference)
Here ‘reference’ signifies the cell position which you wish to check for the presence of a formula.
For example: If you wish to check the cell ‘A2’ for the existence of a formula then you can use this function as
=ISFORMULA(A2)
This function results in a Boolean output i.e. True or False. True signifies that the cell contains formulas while False tells that cell doesn’t contain any formulas.
Method 3: Using a Macro for identifying the cells that contain formulas:
I have created a VBA Macro that can find and color any cells that contain the formula in the total used range of the Active sheet. To use this macro simply follow the below procedure:
1. Open your spreadsheet and hit the ‘Alt + F11’ keys to open the VBA editor.
2. Next, navigate to ‘Insert‘ > ‘Module‘ and then paste the below macro in the editor.
Sub FindFormulaCells()
For Each cl In ActiveSheet.UsedRange
If cl.HasFormula() = True Then
cl.Interior.ColorIndex = 24
End If
Next cl
End Sub
3. For running this formula press the “F5” key.
4. This Macro will change the background colour of all the formula containing cells and thus makes it easier to identify them easily.
Recommended Reading: How to add a Checkbox in excel
What is FIND Function in Excel?
Find function is also one of the most under rated function in excel, which is used to find the text string stored in any cell and returns the position of that cell as output. The most important thing about the Find function is, the cell, which we have taken as a reference, should be in text format. Otherwise, we will end up getting a message as a #Value error message. This also happens; when the Find function is unable to find any text in the selected cell, it eventually returns the #Value error here again.
FIND Formula in Excel
The FIND formula is used to return the position of a substring or special character within a text string.
The Formula for the FIND function is as follows:
The first two arguments are mandatory; the last one is optional.
- find_text (required)- the substring or character you are looking to find.
- within_text (required)- the text string that is to be searched within. Generally, it’s supplied as a cell reference, but you can also type the string directly in the formula.
- start_num (optional)- an option that specifies the position in the within_text string or character from which the search should begin.
If excluded, the search starts from the default value 1 of the within_text string.
If the requested find_text is found, the Find function returns a number that represents the position of the within_text. If the supplied find_text is not found, the function returns the Excel #VALUE! error.
How to Use the FIND Function in Excel?
This FIND Function is very simple easy to use. Let us now see how to use the Find function with the help of some examples.
You can download this FIND Formula Excel Template here – FIND Formula Excel Template
Example #1
In column C of the below spreadsheet, the Find function is used to find various characters in the text string “Original Text”.
The formula used to find the original Text using the FIND function is given below :
Since the Find function is case-sensitive, the lower- and upper-case values, “T” and “t”, gives results which are different (example in cells D4 & D5).
In cell D7, the argument[start_num] is set to 4. Hence the search begins from the fourth character of the within_text string, and so the function gives the second instance of the substring “i”.
Example #2
Suppose we wish to find some of the characters from the below data:
- Data is incorrect
- Revenue increased by 5%
- Original Text
Note that in the above spreadsheet:
- Due to the case-sensitive feature of the FIND function, the uppercase find_text value, “T”, will return 3 as its position.
- Since [start_num] argument is set to 1, the search begins at the first character of the within_text string in cell B8.
Example #3
Find value in a range, worksheet or workbook
The below guidelines will let you know how to find text, specific characters, numbers or dates in a range of cells, worksheet or the entire workbook.
- To start with, select the range of cells to check-in. To search across the whole worksheet, click on any of the cells on the active sheet.
- Open the Find and Replace dialog by pressing the shortcut key Ctrl + F. Alternatively, toggle to the Home tab > Editing group and click Find & Select > Find…
In the Find what box under Find, enter the characters (number or text) you are looking for and click on either Find All or Find Next.
When clicked on Find All, a list of all the occurrences gets opened in Excel, and you can toggle at any of the items in the list to navigate to the nearby cell.
When clicked on Find Next, the first occurrence of the search value on the sheet is selected in Excel, the second click selects the second occurrence, and so on.
FIND Function – additional options:
To fine-tune the search, click on the Options in the right-hand corner of Excel’s Find & Replace dialog, and then try any of the below options:
- To search from the active cell from left to right (row-wise), select By Rows in the Search To check from top to bottom (columnwise), select By Columns.
- To search for a specific value in the entire workbook or current worksheet, select Workbook or Sheet in the Within.
- To search for cells that have only the characters you have entered in the Find what field, select the Match entire cell contents.
- To search among some of the data type, Formulas, Values, or Comments in the Look in.
- For a case-sensitive search, check the Match case check.
Note: If you want to find a given value in a range, column or row, select that range, column(s) or row(s) before opening Find and Replace in Excel. For example, to limit your search to a specific column, select that column first, and then open the Find and Replace dialog.
Find cells with a specific format in Excel:
For finding cells with certain or specific formatting, press the shortcut keys Ctrl + F to open the Find and Replace dialog, click Options, then click the Format… button in the upper right corner, and define your selections in the Find Format dialog box.
To find cells that match a format of some other cell on your worksheet, delete any criteria in the Find what box, click the arrow next to Format, select Choose Format From Cell, and click the cell with the desired formatting.
Note: Microsoft Excel saves the specified formatting. If you search for any other data on a worksheet and Excel is unable to find those values that you know are present, then try clearing the formatting options from the previous search. For doing this, open the Find and Replace dialog, click or select the Options button on the Find tab, then click the arrow beside Format.. and select Clear Find Format.
FIND Function Error:
If you are getting an error from the Find function, this is likely to be the #VALUE! error:
Things to Remember
To correctly use the FIND formula, always remember the following simple facts:
- The FIND function is case sensitive. If you are looking for a match which is case-insensitive, use Excel’s SEARCH function.
- The FIND function does not permit to use of wildcard characters.
- If the find_text argument contains duplicate characters, the FIND function returns the first character’s position. For example, the formula FIND(“xc”, “Excel”) returns 2 because “x” is the 2nd letter in the word “Excel”.
- If within_text has several occurrences of find_text, the first occurrence is returned. For example, FIND(“p”, “Apple”) returns 2, which is the position of the first “p” character in the word “Apple”.
- If find_text is the string is empty “, the FIND formula gives back the first character in the search string.
- The FIND function returns the #VALUE! error if any of the following occurs:
- Find_text does not exist in within_text.
- Start_num contains more characters than within_text.
- Start_num is 0 (zero) or a negative number.
Recommended Articles
This is a guide to the FIND function in Excel. Here we discuss the FIND Formula and how to use FIND Function in Excel along with practical examples and a downloadable excel template. You can also go through our other suggested articles –
- Advanced Excel
- REPLACE Formula in Excel
- VBA Replace
- VBA Find and Replace
What does it do?
Gets the position of a specific text within another text
Formula breakdown:
=FIND(find_text, within_text, [start_num])
What it means:
=FIND(text to be searched, the source text, [starting position of the source text])
If you want to check where a specific text is located in the source text, it is very easy to search for the position using the FIND Formula!
You need to take note that the FIND Formula is case-sensitive when searching for your text! And it always matches the first occurrence. We will see in our examples below!
I explain how you can do this below:
STEP 1: We need to enter the FIND function in a blank cell:
=FIND(
STEP 2: The FIND arguments:
find_text
What is the text to be searched for?
Select the cell containing the text to be searched for. In our first example, we want to search for ‘x’ in the word ‘Excel’:
=FIND(D9,
within_text
What is your source text?
Select the cell source text. So let’s select ‘Excel’ as our source text:
=FIND(D9, C9,
start_num
Where do you want to start searching in your source text?
You can leave this blank, it will default to 1 which means it will start looking from the first character of your source text. In our case, let us put in 1 to start searching from there:
=FIND(D9, C9, 1)
Apply the same formula to the rest of the cells by dragging the lower right corner downwards.
You can see that the matching is case sensitive! And if it’s unable to find your text, it will return #VALUE.
How to Use the FIND Formula in Excel
About The Author
Bryan
Bryan is a best-selling book author of the 101 Excel Series paperback books.
This tutorial demonstrates how to use the FIND Function in Excel and Google Sheets to find text within text.
What Is the FIND Function?
The Excel FIND Function tries to find string of text within another text string. If it finds it, FIND returns the numerical position of that string.
Note: FIND is case-sensitive. So, “text” will NOT match “TEXT”. For case-insensitive searches, use the SEARCH Function.
How to Use the FIND Function
To use the Excel FIND Function, type the following:
=FIND("e", "elephant")
In this case, Excel will return the number 1, because “e” is the first character in the string “elephant”.
Let’s take a look at some more examples:
Start Number (start_num)
The start number tells FIND what numerical position in the string to start looking from. If you don’t define it, FIND will start from the beginning of the string.
=FIND(B3,C3)
Now let’s try defining a start number of 2. Here, we see that FIND returns 3. Because it starts looking from the second character, it misses the first “e” and finds the second:
=FIND(B3,C3,D3)
Start Number (start_num) Errors
If you want to use a start number, it must:
- be a whole number
- be a positive number
- be smaller than the length of the string you are looking in
- not refer to a blank cell, if you define it as a cell reference
Otherwise, FIND will return a #VALUE! error as shown below:
Unsuccessful Searches Return a #VALUE! Error
If FIND does not locate the string you’re looking for, it will return a value error:
FIND is Case-Sensitive
In the example below, we’re searching for “abc”. FIND returns 10 because it is case-sensitive – it ignores “ABC” and the other variations:
FIND Does Not Accept Wildcards
You cannot use wildcards with FIND. Below, we’re looking for “?000”. In a wildcard search, this would mean “any character followed by three zeroes”. But FIND takes this literally to mean “a question mark followed by three zeroes”:
The same applies to the asterisk wildcard:
Instead, to search text with wildcards, you can use the SEARCH Function:
How to Split First and Last Names from a Cell with FIND
If your spreadsheet has a list of names with both the first and last names in the same cell, you might want to split them out to make sorting easier. FIND can do that for you – with a little help from some other functions.
Getting the First Name
The LEFT Function returns a given number of characters from a string, starting from the left.
We can use it to get the first name, but since names are different lengths, how do we know how many characters to return?
Easy – we just use FIND to return the position of the space between the first and last name, subtract 1 from that, and that’s how many characters we tell LEFT to give us.
The formula looks like this:
=LEFT(B3,FIND(“ “,B3)-1)
Getting the Last Name
The RIGHT Function returns a given number of characters from a string, starting from the right.
We have the same problem here as with the first name, but the solution is different, because we have to get the number of characters between the space and the right edge of the string, not the left.
To get that, we use FIND to tell us where the space is, and then subtract that number from the total number of characters in the string, which the LEN Function can give us.
The formula looks like this:
=RIGHT(B3,LEN(B3)-FIND(" ",B3))
If the name contains a middle name, note that it will be split into the last name cell.
Finding the nth Character in a String
As noted above, FIND returns the position of the first match it finds. But what if you want to find the second occurrence of a particular character, or the third, or fourth?
This is possible with FIND, but we’ll need to combine it with a couple of other functions: CHAR and SUBSTITUTE.
Here’s how it works:
- CHAR returns a character based on its ASCII code. For example, =CHAR(134) returns the dagger symbol.
- SUBSTITUTE goes through a string and lets you swap out a character for any other one.
- With SUBSTITUTE you can define an instance number, meaning it can swap the nth occurrence of a given string for anything else.
- So, the idea is, we take our string, use SUBSTITUTE to swap the instance of the character we want to find for something else. We’ll use CHAR to swap it for something that is unlikely to be found in the string, then use FIND to locate that obscure substitute.
The formula looks like this:
=FIND(CHAR(134),SUBSTITUTE(D3,C3,CHAR(134),B3))
And here’s how it works in practice:
FIND Vs SEARCH
FIND and SEARCH are very similar – they both return the position of a given character or substring within a string. However, there are some differences:
- FIND is case sensitive but SEARCH is not
- FIND does not allow wildcards, but SEARCH does
You can see a few examples of these differences below:
FIND in Google Sheets
The FIND Function works exactly the same in Google Sheets as in Excel:
Additional Notes
The FIND Function is case-sensitive.
The FIND Function does not support wildcards.
Use the SEARCH Function to use wildcards and for non case-sensitive searches.
FIND Examples in VBA
You can also use the FIND function in VBA. Type:
application.worksheetfunction.find(find_text,within_text,start_num)
For the function arguments (find_text, etc.), you can either enter them directly into the function, or define variables to use instead.