๐ Excel Basics #26 โ LEN(), FIND() & SEARCH() Functions
When working with real-world data, text is often messy.
You may need to count characters, find specific words, or locate symbols inside text.
That's where LEN(), FIND(), and SEARCH() become useful.
๐ 1. LEN() Function
LEN() counts the number of characters in a text string.
Syntax:
=LEN(text)
Example:
=LEN("Excel") โ Result: 5
Spaces are also counted.
=LEN("Data Analyst") โ Result: 12
๐ 2. FIND() Function
FIND() returns the position of one text string inside another.
Syntax:
=FIND(find_text, within_text, [start_num])
Example:
=FIND("@","rahul@gmail.com") โ Result: 6
The "@" symbol appears at position 6.
โ ๏ธ FIND() is case-sensitive.
=FIND("A","Data") finds uppercase "A". Searching for lowercase "a" gives a different result.
๐ 3. SEARCH() Function
SEARCH() also finds the position of text inside another text string.
Syntax:
=SEARCH(find_text, within_text, [start_num])
Example:
=SEARCH("analyst","Data Analyst") โ Result: 6
Unlike FIND(), SEARCH() is not case-sensitive.
So =SEARCH("ANALYST","Data Analyst") also returns: 6
๐ FIND() vs SEARCH()
FIND():
โข Case-sensitive
โข Does not support wildcards
โข Useful when exact capitalization matters
SEARCH():
โข Not case-sensitive
โข Supports wildcards such as ** and ?
โข Useful for flexible text searches
๐ Real-World Example
Suppose: A2 = "rahul.sharma@gmail.com"
Find the position of "@":
=FIND("@",A2) โ Result: 13
Count the total characters:
=LEN(A2)
Use with LEFT(), RIGHT(), or MID() to extract parts.
To extract everything before "@":
=LEFT(A2,FIND("@",A2)-1) โ Result: rahul.sharma
๐ Common Mistake
If FIND() or SEARCH() cannot find the text, Excel returns: #VALUE!
Handle it using:
=IFERROR(SEARCH("@",A2),"Not Found")
๐ Real-World Uses
โข Find "@" in email addresses
โข Locate hyphens or separators in IDs
โข Count characters in customer names
โข Extract usernames from email addresses
โข Clean and transform raw datasets
โข Identify whether specific text exists within a cell
Remember:
LEN() โ How many characters?
FIND() โ Where is it? Case-sensitive
SEARCH() โ Where is it? Not case-sensitive
These functions become even more powerful when combined with LEFT(), RIGHT(), MID(), and IFERROR().
Double Tap โค๏ธ For More
Post #2254
3K
- โค 11
- ๐ 1