You can use the following formula in Excel to extract all characters from the right side of a cell until a space is encountered:

=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",255)),255))

This particular example extracts all of the characters on the right side of the string in cell **A2** until a space is encountered.

For example, if cell **A2** contains **The Dallas Mavericks** then this formula would return **Mavericks** since this represents all of the characters on the right side of the cell until a space is encountered.

The following example shows how to use this formula in practice.

**Example: Extract Characters from Right Until Space in Excel**

Suppose we have the following list of basketball team names in Excel:

We can type the following formula into cell **B2** to extract all of the characters on the right side of the team name of cell **A2** until a space is encountered:

=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",255)),255))

We can then click and drag this formula down to each remaining cell in column B:

Column B now displays all of the characters on the right side of each cell in column B until a space is encountered.

Notice that if multiple spaces are present in a cell, the formula is capable of identifying the last space and extracts only the characters to the right of it.

**Note**: The most recent versions of Excel now offer a **TEXTAFTER** function, which you can use to extract the text from a cell after a specific character.

You can use the following syntax to extract all characters to the right of the last space in a cell:

=TEXTAFTER(A2, " ", -1)

Column B now all of the characters on the right side of each cell in column B until a space is encountered.

Notice that this formula produces the same results as the previous formula.

**Additional Resources**

The following tutorials explain how to perform other common operations in Excel: