FIND Function in Excel

Part 1: Introduce

💡 Definition: The FIND function in Microsoft Excel is a text function that helps locate the position of a specific character or text string within another text string. It returns the starting position of the found text.

🎯 Purpose: The purpose of the FIND function is to enable users to identify the position of a particular character or text within a larger text string. It is commonly used to extract specific information or perform further operations based on the identified position.

📚 Syntax & Arguments: The syntax of the FIND function is as follows:

syntax
=FIND(find_text, within_text, [start_num])
  • find_text: This is the required argument that specifies the text or character you want to find within another text.
  • within_text: This is the required argument that represents the text string or cell reference within which you want to search for the find_text.
  • start_num: This optional argument denotes the position   within_text where the search should begin. If omitted, the search starts from the first character.

🔍 Explain the Arguments in the function:

  • find_text: It can be a text string or a cell reference containing the text you want to locate within the within_text.
  • within_text: It is a text string or a cell reference containing the larger text string in which you want to search for the find_text.
  • start_num: It is an optional argument that allows you to specify the position   within_text where the search should start. If omitted, the search begins from the first character.

💡 Return Value: The FIND function returns the numeric value that represents the starting position  find_text within the within_text. If the find_text is not found, it returns the #VALUE! Error.

📝 Remarks:

  • The FIND function is case-sensitive, differentiating between uppercase and lowercase letters.
  • If you require a case-insensitive search, you can use the related function, SEARCH, instead.
  • If the find_text appears multiple times within the, the FIND function returns the position of the first occurrence.
  • The FIND function counts each character, including spaces, as a position within the within_text.

Part 2: Examples

Let’s explore three examples that demonstrate the usage of the FIND function:

1️⃣ Example 1: Finding the Position of a Character

AB
1TextPosition
2Hello=FIND(“o”, A2)
3Excel=FIND(“l”, A3)
4World=FIND(“d”, A4)

In this example, we have text strings in column A, and we want to find the position of a specific character within each text string. The FIND function is used in column B to determine the status.

  • The formula =FIND("o", A2) cell B2 finds the letter “o” position within the text string “Hello”. It returns the value 5, indicating that “o” is in the fifth position.
  • The formula =FIND("l", A3) cell B3 finds the letter “l” position within the text string “Excel”. It returns the value 2, indicating that the first “l” is at the second position.
  • The formula =FIND("d", A4) in cell B4, the letter “d” position is found within the text string “World”. It returns the value 4, indicating that “d” is at the fourth position.

2️⃣ Example 2: Extracting a Substring

AB
1TextSubstring
2OpenAI=MID(A2, FIND(“n”, A2), 4)
3Microsoft=MID(A3, FIND(“r”, A3), 6)
4Python=MID(A4, FIND(“t”, A4), 3)

In this example, we have text strings in column A, and we want to extract a substring based on the position of a specific character. The FIND function is combined with the MID function in column B to remove the substrings.

  • The formula =MID(A2, FIND("n", A2), 4) in cell B2, find the letter “n” position within the text string “OpenAI” using the FIND function. Using the MID function, It extracts a substring of four characters starting from the “n” position. It returns the value “nAI”.
  • The formula =MID(A3, FIND("r", A3), 6) in cell B3, find the position of the letter “r” within the text string “Microsoft” using the FIND function. Using the MID function, It extracts a substring of six characters starting from the “r” position. It returns the value “rosoft”.
  • The formula =MID(A4, FIND("t", A4), 3) cell B4, find the position of the letter “t” within the text string “Python” using the FIND function. Using the MID function, It extracts a substring of three characters starting from the “t” position. It returns the value “tho”.

3️⃣ Example 3: Checking for Substring Existence

AB
1TextSubstring Found
2OpenAI=IF(ISNUMBER(FIND(“AI”, A2)), “Yes”, “No”)
3Microsoft=IF(ISNUMBER(FIND(“Corp”, A3)), “Yes”, “No”)
4Python=IF(ISNUMBER(FIND(“Java”, A4)), “Yes”, “No”)

In this example, we have text strings in column A, and we want to check if a specific substring exists within each text string. The FIND function is combined with the IF and ISNUMBER functions in column B to determine the existence of the substring.

  • The formula =IF(ISNUMBER(FIND("AI", A2)), "Yes", "No") cell B2 checks if the substring “AI” is present within the text string “OpenAI” using the FIND function. If it exists, it returns “Yes”; otherwise, it replaces “No”. In this case, it replaces “Yes”.
  • The formula =IF(ISNUMBER(FIND("Corp", A3)), "Yes", "No") cell B3 checks if the substring “Corp” is present within the text string “Microsoft”. It returns “No” because the substring is not found.
  • The formula =IF(ISNUMBER(FIND("Java", A4)), "Yes", "No") cell B4 checks if the substring “Java” is present within the text string “Python”. It returns “No” as the substring is not found.

These examples showcase the versatility of the FIND function in locating specific characters or text within text strings and using the results for various operations and analyses in business scenarios.

 

4️⃣ Example 4: Extracting Domain from Email Address

AB
1Email AddressDomain
2[email protected]=MID(A2, FIND(“@”, A2) + 1, LEN(A2) – FIND(“@”, A2))
3[email protected]=MID(A3, FIND(“@”, A3) + 1, LEN(A3) – FIND(“@”, A3))
4[email protected]=MID(A4, FIND(“@”, A4) + 1, LEN(A4) – FIND(“@”, A4))

In this example, we have email addresses in column A, and we want to extract the domain from each email address. The FIND function is nested with column B’s MID and LEN functions to achieve the desired result.

  • The formula =MID(A2, FIND("@", A2) + 1, LEN(A2) - FIND("@", A2)) in cell B2 extracts the domain from the email address “[email protected]“. It uses the FIND function to locate the position of the “@” symbol, adds 1 to get the starting position of the domain, and then uses the MID function to extract the remaining characters from that position. It returns “example.com.”
  • The formula =MID(A3, FIND("@", A3) + 1, LEN(A3) - FIND("@", A3)) in cell B3 extracts the domain from the email address “[email protected]“. It follows the same logic as in cell B2 and returns “company.com”.
  • Similarly, the formula in cell B4 extracts the domain from the email address “[email protected]“.

5️⃣ Example 5: Counting Occurrences of a Word in a Text String

ABC
1TextWord to CountCount
2Hello, how are you?how=LEN(A2)-LEN(SUBSTITUTE(A2,B2,””)))/LEN(B2)
3I’m doing well, how about you?you=(LEN(A3)-LEN(SUBSTITUTE(A3,B3,””)))/LEN(B3)
4Howdy! How’s it going?how=(LEN(A4)-LEN(SUBSTITUTE(A4,B4,””)))/LEN(B4)

In this example, we have text strings in column A, and we want to count the occurrences of a specific word within each text string. The FIND function is nested with column C’s SUBSTITUTE, LEN, and division operators to calculate the events.

  • The formula =(LEN(A2)-LEN(SUBSTITUTE(A2,B2,"")))/LEN(B2) cell C2 counts the occurrences of the word “how” in the text string “Hello, how are you?”. It uses the FIND function nested with the SUBSTITUTE and LEN functions. It calculates the difference between the lengths of the original text string and the text string with the word removed and then divides it by the length of the term to get the count. It returns the value 1.
  • The formula in cell C3 counts the occurrences of the word “you” in the text string “I’m doing well, how about you?”.
  • Similarly, the formula in cell C4 counts the occurrences of the word “how” in the text string “Howdy! How’s it going?”.

6️⃣ Example 6: Extracting Initials from Full Name

AB
1Full NameInitials
2John Doe=CONCATENATE(UPPER(LEFT(A2, 1)), “.”, UPPER(LEFT(MID(A2, FIND(” “, A2) + 1, LEN(A2)), 1)))
3Jane Smith=CONCATENATE(UPPER(LEFT(A3, 1)), “.”, UPPER(LEFT(MID(A3, FIND(” “, A3) + 1, LEN(A3)), 1)))
4Alex Brown=CONCATENATE(UPPER(LEFT(A4, 1)), “.”, UPPER(LEFT(MID(A4, FIND(” “, A4) + 1, LEN(A4)), 1)))

In this example, we have full names in column A and want to extract the initials from each full name. The FIND function is nested with the MID, LEFT, UPPER, and CONCATENATE functions in column B to extract the initials.

  • The formula =CONCATENATE(UPPER(LEFT(A2, 1)), ".", UPPER(LEFT(MID(A2, FIND(" ", A2) + 1, LEN(A2)), 1))) cell B2 extracts the initials from the full name “John Doe”. It uses the FIND function to locate the position of the space between the first and last names. Then, it uses the MID function to extract the last name starting from the part after the opening. Finally, it combines the first and last names’ first letters using the LEFT, UPPER, and CONCATENATE functions. It returns “J.D”.
  • The formula in cell B3 extracts the initials from the full name “Jane Smith”.
  • Similarly, the formula in cell B4 removes the initials from the full name “Alex Brown”.

7️⃣ Example 7: Checking for Substring Existence and Returning Value

AB
1TextResult
2Project ABC=IF(ISNUMBER(FIND(“ABC”, A2)), “Match”, “No Match”)
3Task XYZ=IF(ISNUMBER(FIND(“ABC”, A3)), “Match”, “No Match”)
4Report ABCD=IF(ISNUMBER(FIND(“ABC”, A4)), “Match”, “No Match”)

In this example, we have text strings in column A, and we want to check if a specific substring exists within each text string. If a match is found, we want to return a particular value. The FIND function is nested with column B’s ISNUMBER and IF functions to achieve the desired outcome.

  • The formula =IF(ISNUMBER(FIND("ABC", A2)), "Match", "No Match") cell B2 checks if the substring “ABC” exists within the text string “Project ABC”. It uses the FIND function to locate the position of “ABC”, and the ISNUMBER function checks if it is found. If a match is found, it returns “Match”; otherwise, it replaces “No Match”.
  • The formula in cell B3 checks the substring “ABC” in the text string “Task XYZ”.
  • Similarly, the formula in cell B4 checks the substring “ABC” in the text string “Report ABCD”.

These examples showcase how the FIND function can be nested with various other parts to accomplish different tasks in business scenarios. By leveraging the power of nested functions, you can extract specific information, count occurrences, perform checks, and generate desired outcomes based on your particular requirements.

Part 3: Tips and Tricks

Here are some tips and tricks related to the FIND function:

  1. Use the FIND function to search for individual characters and complete text strings within larger text strings.
  2. Combine the FIND function with other functions like MID, LEFT, or RIGHT to extract or manipulate specific parts of a text string based on the identified position.
  3. To perform a case-insensitive search, use the related function, SEARCH, instead of FIND.
  4. Remember that the FIND function returns an error (#VALUE!) if the specified text is not found. You can use the ISNUMBER function or error-handling techniques to handle such scenarios.
  5. Pay attention to the position returned by the FIND function, as it represents the starting position of the found text within the larger text string.

By utilizing the FIND function effectively, you can locate and extract specific information within text strings, enabling you to perform various data manipulations and analyses in Excel.