Module 9 ยท Lesson 47
TEXTBEFORE, TEXTAFTER, and SUBSTITUTE
Split delimited values and replace known text patterns.
TEXTBEFORE, TEXTAFTER, and SUBSTITUTE: what Excel is actually doing
TEXTBEFORE and TEXTAFTER split around a delimiter; SUBSTITUTE replaces chosen text and can target a specific occurrence. They are clearer than positional extraction when separators carry meaning.
Read this TEXTBEFORE, TEXTAFTER, and SUBSTITUTE example
Start with the business need: Separate an order prefix from its sequence number. Read each argument, reference, field, or control in the example before copying it into a larger model.
=TEXTBEFORE(A2,"-")Evidence that your TEXTBEFORE, TEXTAFTER, and SUBSTITUTE result is trustworthy
Keep a raw-data column and count blanks, unexpected lengths, and unresolved patterns after cleaning.
- Explain how the result supports this task: Separate an order prefix from its sequence number.
- Retain one known-result check and one boundary or exception check.
- Record the source, period, unit, and refresh assumption beside the output.
The TEXTBEFORE, TEXTAFTER, and SUBSTITUTE mistake to catch
A delimiter may appear more than once or not at all. Decide which occurrence and missing behaviour are valid.
Your desk challenge for lesson 47
Split an email into user and domain, then replace only the second hyphen in a compound code.
- Preserve the original imported field.
- Apply one cleanup or extraction rule per helper column.
- Compare row counts and inspect values that do not follow the expected pattern.
Key takeaway: Split an email into user and domain, then replace only the second hyphen in a compound code.