Spreadsheet formulas explained, side by side

RIGHT Function in Excel, Google Sheets, Airtable & Notion

RIGHT returns a set number of characters from the end of a text string. RIGHT("INV-2024-0042", 4) is “0042”.

Syntax in each app

AppSupportSyntax & notes
Excel✔ Built inRIGHT(text, [num_chars])
num_chars defaults to 1.
Google Sheets✔ Built inRIGHT(string, [number_of_characters])
Airtable✔ Built inRIGHT(string, howMany)
Notion≈ Workaroundsubstring(text, max(length(text) - n, 0), length(text))
No RIGHT in Notion. Start n characters before the end; max(…, 0) stops the start going negative when n is longer than the text.
Try RIGHT with your own values
Leave empty for 1
Result (as Excel & Google Sheets return it)
0042 4 characters
Your formula, ready to paste
Excel=RIGHT("INV-2024-0042", 4) open excel.new ↗
Google Sheets=RIGHT("INV-2024-0042", 4) open sheets.new ↗
AirtableRIGHT("INV-2024-0042", 4)
Notion
workaround
substring("INV-2024-0042", max(length("INV-2024-0042") - 4, 0), length("INV-2024-0042"))

Arguments

ArgumentWhat it means
textThe text to take characters from.
[num_chars] optionalHow many characters to return from the end. Defaults to 1; negative is #VALUE!.

Examples

FormulaResultWhyCopy
=RIGHT("INV-2024-0042", 4)0042Leading zeros are kept because the result is text.
=RIGHT(A2, LEN(A2) - FIND(" ", A2))Last nameEverything after the first space.
="**** "&RIGHT("4111222233334444", 4)**** 4444Mask all but the last four digits.
=RIGHT("Report.xlsx", 5).xlsxA file extension.

Examples use Excel / Google Sheets syntax unless noted.

How RIGHT works

RIGHT is the mirror of LEFT. Use it for suffixes: the last 4 digits of an account number, a file extension, the check digit of a code. When the part you want is variable length, work out its length first: =RIGHT(A2, LEN(A2) - FIND("-", A2)) keeps everything after the first dash.

Like LEFT, RIGHT returns text, so “0042” keeps its leading zeros, which is often what you want for IDs. Applied to a number, it works on the digits as they are stored, not as they are formatted: =RIGHT(1234.5, 2) is “.5”, and a currency-formatted cell won't include the $ sign.

Airtable's RIGHT(string, howMany) behaves the same way. Notion has no RIGHT; the equivalent is a substring() that starts n characters before length(text). Notion positions start at 0 and the end position is exclusive.

Frequently Asked Questions

How do I get the text after the last dash or slash?
In Excel 365 use =TEXTAFTER(A2, "-", -1). Elsewhere use regex extraction (REGEXEXTRACT(A2, "[^-]*$") in Google Sheets, REGEX_EXTRACT in Airtable).

Part of the Text functions. Results in the tester follow Excel and Google Sheets behaviour; always double-check important work in your own file.