Dynamic Text Finding & Slicing: FIND vs SEARCH with MID
Overview & Learning Objectives
When string lengths vary—such as customer email addresses and full names—hardcoded character counts fail. Combining FIND or SEARCH with MID and LEFT dynamically slices text at specific delimiter characters (like "@" or space " ").
- Contrast FIND (case-sensitive, no wildcards) with SEARCH (case-insensitive, supports wildcards).
- Dynamically split First Names and Last Names of varying lengths.
- Extract email domain names dynamically using FIND and MID.
Industry Standard
Standard: Marketing operations teams routinely sanitize CRM exports using dynamic FIND & MID formulas before syncing leads into Salesforce or HubSpot.
Real-World Example: Customer Relationship Management (CRM) Name & Email Splitting
At GrowthPulse CRM, customer records arrive with mixed emails like `sachin.sharma@datacliq.in` and `ananya@infosys.com`. A dynamic formula extracts the domain name (`datacliq.in`, `infosys.com`) regardless of email length.
| Customer Email | Delimiter Position (FIND) | Username (LEFT) | Domain Name (MID) |
|---|---|---|---|
| sachin.sharma@datacliq.in | 14 | =LEFT(A2, FIND("@", A2)-1) | =MID(A2, FIND("@", A2)+1, 100) |
| ananya@infosys.com | 7 | ananya | infosys.com |
| vikram.k@tcs.com | 9 | vikram.k | tcs.com |
Functions Covered in this Chapter
Here is the definition, exact syntax, parameter breakdown, and real-world business example for each function covered in this chapter:
FIND Function
Definition: Locates the starting character position of a substring inside a text string (case-sensitive, does not support wildcards).
=FIND(find_text, within_text, [start_num])
find_text: The character or substring you are searching for (e.g. "@" or " ").within_text: The cell containing the text being searched.[start_num]: Optional character position where search begins (default is 1).
=FIND("@", A2)SEARCH Function
Definition: Locates the starting character position of a substring (case-insensitive and supports wildcards * and ?).
=SEARCH(find_text, within_text, [start_num])
find_text: The substring to locate (supports * for wildcard matching).within_text: The text being evaluated.
=SEARCH("ltd", A2)SUBSTITUTE Function
Definition: Replaces specific occurrences of an existing substring with new text by string value.
=SUBSTITUTE(text, old_text, new_text, [instance_num])
text: The source string.old_text: The string to be replaced.new_text: The replacement string.[instance_num]: Which occurrence to replace (if omitted, replaces all occurrences).
=SUBSTITUTE("98765-43210", "-", " ")REPLACE Function
Definition: Replaces a specific number of characters inside a text string based on character position numbers.
=REPLACE(old_text, start_num, num_chars, new_text)
old_text: The source text.start_num: Starting character position.num_chars: How many characters to remove.new_text: Replacement text to insert.
=REPLACE(A2, 4, 4, "XXXX")Common Mistakes & Limitations
- FIND returns `#VALUE!` if the search text is not found. Always wrap in `IFERROR` or `ISNUMBER` when text might be missing.
- Using FIND when you need case-insensitive matching; use SEARCH instead.
Keyboard Shortcuts
| Action | Windows | Mac |
|---|---|---|
| Evaluate Formula Step | Alt + M + V | Formulas Ribbon |
| Find & Replace Dialog | Ctrl + H | Ctrl + H |
Pro Tips & Modern Alternatives
- In Excel 365, use `=TEXTBEFORE(A2, "@")` and `=TEXTAFTER(A2, "@")` to eliminate FIND/MID completely.
- Use Text to Columns with Delimiter = "@" for fast 1-click batch splitting.