Text

RIGHT Formula

RIGHT extracts a specified number of characters from the end (right side) of a text string. It is useful for pulling file extensions, extracting the last digits of an ID number, or isolating suffixes. Like LEFT, it works best with FIND or LEN for dynamic extraction lengths.

Syntax

RIGHT(text, [num_chars])
ParameterDescription
text Parameter of the RIGHT function.
[num_chars] (Optional.) Parameter of the RIGHT function.
Try RIGHT in Viztab — free, no signup

Examples

Extract file extension

Formula
=RIGHT(A2, 3)
Returns: "pdf" — the last 3 characters from "report.pdf"

Get last 4 digits of a phone number

Formula
=RIGHT(A2, 4)
Returns: "1234" — from "212-555-1234"

Extract domain extension

Formula
=RIGHT(A2, LEN(A2)-FIND(".", A2))
Returns: "com" — extracts everything after the dot in "example.com"

Common Errors

#VALUE!

The num_chars argument is negative. It must be zero or positive.

#VALUE!

The cell contains a number, not text. Use TEXT() to convert first: =RIGHT(TEXT(A1, "0000"), 2).

Tips

Extract last name

=RIGHT(A1, LEN(A1)-FIND(" ", A1)) gets everything after the first space in "John Smith".

Works with numbers as text

If a cell shows 00542, RIGHT(A1,3) returns "542". Make sure the cell is formatted as text to preserve leading zeros.

Last N characters

=RIGHT(A1, 1) gives just the last character — useful for checking suffixes or trailing characters.

Try RIGHT in Viztab

Import your data and use RIGHT with 370+ other formulas. No signup required.

Open Viztab

Related Formulas