To extract N letters away from the Nth last letter in the text string, you need to use Right Function.
Formula:
Copy the formula and replace "A1" with the cell name that contains the text you would like to extract, and change N to the number you need.
=RIGHT(LEFT(A1,LEN(A1)-N),N)
Example:
To extract the 6 letters away from the 5th last letter from text string "How to Extract N Letters away from the Nth Last Letter".
The result returns the six-letter "Last L".
Explanations:
Step 1: To find the length of the text string
Formula | =LEN(A1) |
---|---|
Result | 54 |
Step 2: Extract the text from the string without the last 5 letters
Formula | =LEFT(A1,LEN(A1)-5) |
---|---|
Result | How to Extract N Letters away from the Nth Last L |
Step 3: Extract six letters away from the 5th last (or the last six letters from step 2)
Formula | =RIGHT(LEFT(A1,LEN(A1)-5),6) |
---|---|
Result | Last L |