Quick Answer

RIGHT Function

RIGHT extracts a specified number of characters from the right side of a text string.

✓ Excel✓ Google SheetsExcel All versions

Syntax

RIGHT
(text, [num_chars])

Parameters

ParameterDescriptionRequired
textThe text string from which to extract characters.Required
num_charsOptional. The number of characters to extract (default is 1).Optional

Basic Example

Extract last 4 characters

=RIGHT("Hello World", 4)
Resultorld

Extracts the last 4 characters from "Hello World".

Advanced Examples

Example 1: Extract file extension

File management

Get the extension from a filename

=RIGHT(A1, LEN(A1)-FIND(".", A1))
Result: .txt
Combines RIGHT with LEN and FIND to extract text after the dot.

Example 2: Extract last name

Name parsing

Get the last name from "First Last" format

=RIGHT(A1, LEN(A1)-FIND(" ", A1))
Result: Smith
Extracts text after the first space.

How RIGHT Works

RIGHT counts from the end of the text string and returns the specified number of characters. If num_chars is omitted, it returns just the last character.

1
Select output cell
Choose where the result should appear.
2
Enter formula
Type =RIGHT(text, number_of_characters).
3
Press Enter
The result shows the extracted text.

Important Notes & Limitations

  • RIGHT counts each character as 1, including spaces.

  • Use LEFT to extract from the beginning, or MID to extract from the middle.

Common Errors & Fixes

#VALUE!num_chars is negative

Fix: Ensure num_chars is a positive number.

Download Practice File

Practice RIGHT with Real Data

Download a sample CSV file with pre-populated data and practice exercises for the RIGHT function. Works in both Excel and Google Sheets.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

Does RIGHT work with numbers?
Yes, numbers are treated as text.
What if num_chars exceeds the text length?
RIGHT returns the entire text string.