Explanation

This formula takes advantage of the fact that TRIM will remove any number of leading spaces.

We look for line breaks and “flood” the text with spaces where we find one.

Then we come back and grab text from the right.

Excel formula: Extract nth word from text string

Next, the RIGHT function extracts 200 characters, starting from the right.

Note: 200 is an arbitrary number that represents the longest line you expect to find in a cell.

If you have longer lines, increasethis number as needed.

Excel formula: Get first word

SUBSTITUTE Function

The Excel SUBSTITUTE function replaces text in a given string by matching.

For example, =RIGHT(“apple”,3) returns “ple”.

REPT Function

The Excel REPT function repeats characters a given number of times.

Excel formula: Get last word

For example, =REPT(“x”,5) returns “xxxxx”.

CHAR Function

The Excel CHAR function returns a character when given a valid character code.

CHAR can insert characters that are hard to enter into a formula.

Excel TRIM function

Excel SUBSTITUTE function

Excel RIGHT function

Excel REPT function

Excel CHAR function

Article image

Article image

Article image