SheetsLessons
Text function

RIGHT function in Google Sheets

RIGHT returns a set number of characters from the end of a text string. Use it for suffixes, file extensions, last digits and region codes.

Syntax

=RIGHT(string, [number_of_characters])
string
The text to extract from.
number_of_characters
Optional. How many characters to take (default 1).

Practice RIGHT

Task 1 of 1

Extract the 2-letter warehouse code from the end of the SKU. Answer in B2.

B2
fx

Tip: while typing a formula, click a cell or drag across cells to insert references. Press Enter to check, and Tab to accept a function suggestion.

RIGHT examples

Each example below runs against this sample sheet. The results are calculated by the same engine as the practice grid.

ABC
1Raw nameSKUNote
2  maya   PATEL ELC-0427-NYRefund requested
3leo rossiFUR-1180-TXShipped
4AVA KIMOFC-0093-CARefund issued
Messy imported data
FormulaResultWhat it shows
=RIGHT(B2, 2)NYWarehouse code at the end of the SKU.
=RIGHT(B3, 7)1180-TXLast seven characters.
=RIGHT(A3, LEN(A3) - FIND(" ", A3))rossiLast name: everything after the first space.

Tips and common mistakes

  • To take "everything after X", subtract X's position from the total length as in the last example.

Related functions