Course outline / Text functions

Lesson 33 of 75 · Intermediate · 5 exercises

Splitting text into parts

Split emails, codes and names into their parts.

Start this lesson free

What you'll practise

  1. The part before the @
  2. The domain after the @
  3. The middle part of a code
  4. The domain in any version of Excel
  5. The middle name

The part before the @

In cell E2, use TEXTBEFORE to get the user name from the email in A2: everything before the @.

The domain after the @

In cell E2, use TEXTAFTER to get the domain from A2: everything after the @.

The middle part of a code

Codes often have parts separated by dashes. TEXTBEFORE and TEXTAFTER can be combined: take what comes after the first dash, then what comes before the next one.

In cell E2, get the middle part of B2: TEXTBEFORE(TEXTAFTER(B2,"-"),"-").

The domain in any version of Excel

Without TEXTAFTER, use MID and FIND: start one character after the @ and take plenty of characters.

In cell E2, get the domain of A2 with MID(A2, FIND("@",A2)+1, 100).

The middle name

In cell E2, get Maria Luisa Ortiz's middle name from C2: the text after the first space and before the last one.

Try it in a real spreadsheet

Every step checks your answer instantly and tells you exactly what to fix.

Start the lesson

Function guides

← Text and numbers togetherReplacing parts of text →