Advanced Formula Combinations
Swipe to show menu
Many real-world datasets contain multiple pieces of information inside a single text field. In this chapter, combine text functions to extract structured information dynamically from email addresses.
LEN Structure
=LEN(text)
text: evaluated string.
LEN returns the total number of characters in a string.
FIND Structure
=FIND(find_text, within_text, [start_num])
find_text: character or text being searched;within_text: evaluated string;[start_num]: optional starting position.
FIND returns the position of a character inside a string.
LEFT Structure
=LEFT(text, num_chars)
text: evaluated string;num_chars: number of characters extracted from the left side.
MID Structure
=MID(text, start_num, num_chars)
text: evaluated string;start_num: extraction starting position;num_chars: number of characters extracted.
Move to:
Customers_Clean
The email data has already been standardized using SUBSTITUTE.
Add the following columns:
Email_Username
Email_Domain
Email_Valid
Type:
=FIND("@", Customers_Clean[@Email_Clean])
The formula returns the position of the @ delimiter.
Type:
=LEFT([@[Email_Clean]], FIND("@", [@[Email_Clean]]) - 1)
FIND(...) - 1: identifies the last character before@;LEFT(...): extracts the username portion.
Type:
=MID([@[Email_Clean]], FIND("@", [@[Email_Clean]]) + 1, LEN([@[Email_Clean]]) - FIND("@", [@[Email_Clean]]))
FIND(...) + 1: starts extraction after@;LEN(...) - FIND(...): calculates remaining character count.
The formula dynamically extracts domains regardless of length.
Modify several email addresses with:
- Different username lengths;
- Different domain lengths;
- Different domain providers.
Confirm that the extraction formulas continue working dynamically.
1. What is the main reason LEN is used in text extraction formulas like MID?
2. Why is FIND preferred over manual positioning when extracting parts of an email?
3. In the email domain extraction formula, what is the role of LEN - FIND("@", …)?
Thanks for your feedback!
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat