RIGHT Function in Excel: Extract Characters from End
Returns the last character or characters in a text string, based on the number of characters you specify.
How to Extract Characters from the Right in Excel
The RIGHT function returns a specified number of characters from the end (right side) of a text string.
Syntax
=RIGHT(text, [num_chars])
Example: Extracting Last 4 Digits
To extract the last 4 digits of a credit card or phone number in cell A2: =RIGHT(A2, 4)
Common Errors & Fixes
RIGHT returns wrong characters
Causes:- Incorrect num_chars value — counting from the end is counterintuitive.
- Trailing spaces in the text are included in the count.
Fixes:- Use LEN to verify text length first.
- Use TRIM to remove trailing spaces before applying RIGHT.
Frequently Asked Questions
How do I use RIGHT to extract text after a specific character?
Combine RIGHT with FIND: =RIGHT(A1, LEN(A1) - FIND("@", A1)) extracts everything after the @ symbol in an email.
What happens if num_chars is negative?
RIGHT returns a #VALUE! error if num_chars is negative. Always use a positive number.
Does RIGHT work in Google Sheets?
Yes, RIGHT works identically in Google Sheets with the same syntax.
Related Formulas
Explore related formula generators to solve similar problems
🛠️ Related Tools
Want to become an Excel Pro?
Stop searching for formulas. Master Excel in 30 days with this top-rated course.
Learn More