Online Excel Editor
Free Use

RIGHT in Excel: Syntax, Examples and Errors

Updated 2026-10-14 · Free · Works in Excel & Google Sheets

Syntax

=RIGHT(text, [num_chars])

Quick answer

RIGHT returns characters from the end of a cell: =RIGHT(A2, 4) turns "AE-2026-041" into "-041". The count defaults to 1, asking for more than the cell length just returns the whole text, and the result is always text — even when it looks like a number.

Syntax

=RIGHT(text, [num_chars])
ArgumentWhat it means
textThe cell or literal holding the text to cut. Required.
[num_chars]How many characters to take from the end: 4 takes the last four. Omit it and RIGHT takes exactly one. Must be zero or positive — negative returns #VALUE!.

Depending on your regional settings, arguments are separated by semicolons instead of commas: =RIGHT(A2; 4). This is standard in countries where the comma is the decimal separator.

RIGHT counts characters, not bytes and not words: one letter, one digit, one space or one emoji each consume a count. Positions are measured from the end — there is no character zero.

Basic examples

=RIGHT(A2, 4)

The fixed-width workhorse: product codes "AE-2026-041" hand over their suffix "-041", phone numbers give up their last four digits, and account numbers expose their check digit — any time the meaningful part always lives in the last N characters.

=RIGHT(A2, LEN(A2) - SEARCH(" ", A2))

The dynamic upgrade: SEARCH locates the first space, LEN measures the whole cell, and RIGHT takes everything after that space, so "Jane Doe" yields "Doe" and "Winston Churchill" yields "Churchill" — the cut point follows the data instead of a hard-coded number.

=RIGHT(A2, LEN(A2) - FIND("@", A2))

Extracts the domain of "john.doe@example.com" — "example.com". Use FIND when case matters (it is case-sensitive); SEARCH when it does not, or when you need wildcards.

=IFERROR(RIGHT(A2, LEN(A2) - SEARCH("-", A2)), A2)

The production-grade version: rows without a dash would otherwise explode into #VALUE! because SEARCH finds nothing. Wrapped in IFERROR, those rows simply come back whole instead of breaking the column.

RIGHT returns text even when it carves out digits: RIGHT(123456, 3) gives the text "456", which will not sum. Wrap numeric extractions in VALUE (=VALUE(RIGHT(A2, 3))), and remember dates join as serial numbers — RIGHT of a date carves characters out of the serial, not the display.

Common errors and how to fix them

SymptomMost common causeFix
#VALUE!num_chars is negative — or the FIND/SEARCH feeding it cannot locate the delimiter, which itself returns #VALUE!.Use a positive count, and wrap the delimiter hunt in IFERROR with a fallback, or check the data for missing separators first.
Only one character comes backnum_chars was omitted — without it RIGHT assumes 1.Add the count: =RIGHT(A2, 4). If you genuinely want one character, writing 1 explicitly documents the intent.
The cut lands one character early or lateOff-by-one around the delimiter: to exclude the delimiter you add nothing; to keep it you subtract one from the offset.Map it out on one row — LEN minus the delimiter position gives the count of characters after it, excluding the delimiter itself.
Extracted digits will not calculateRIGHT always returns text, so "007" stays "007" and "456" does not sum.=VALUE(RIGHT(A2, 3)) converts the carved-out digits into a real number (losing leading zeros, which were text anyway).
Trailing spaces shift the resultThe cell ends with invisible padding, so the last characters are spaces, not letters.Clean first: =RIGHT(TRIM(A2), 4), or strip whitespace on the whole column in one pass.

Not an error, but a classic surprise: asking RIGHT for more characters than the cell holds returns the entire cell, not an error. =RIGHT("Hi", 50) is just "Hi" — handy for padding-free safe cuts, confusing when you expected a warning.

RIGHT vs. MID

RIGHTMID
Starts cutting fromAlways the last characterAny position you specify: =MID(A2, 5, 3)
ArgumentsText and a countText, a start position and a count
Best forSuffixes, last names, file extensions, check digitsMiddle segments — area codes, the part between two delimiters
Dynamic endOnly the start can move (via FIND/SEARCH and LEN)Both ends can move — FIND feeds the start position

RIGHT is a specialized MID with a permanent tail anchor: =RIGHT(A2, 4) equals =MID(A2, LEN(A2) - 3, 4) when the cell is long enough. When the segment can sit anywhere but the end, move to MID — the two functions nest together constantly in parsing formulas.

RIGHT vs. Text to Columns and TEXTAFTER

RIGHT (+ FIND/SEARCH)Text to ColumnsTEXTAFTER (Microsoft 365)
OutputA live formula in a new column; source untouchedSplits the cells in place, overwriting neighbors if you are not carefulA live formula: =TEXTAFTER(A2, " ")
Delimiter logicHand-built with FIND/SEARCH and LEN minus offsetDialog-driven, handles repeated delimiters visuallyOne argument — no FIND, no LEN math
Survives new rowsYes — fill down and it recalculatesNo — rerun on the new dataYes — dynamic by design
Available inEvery Excel version and Google SheetsEvery Excel versionExcel 365 / 2021 and later only

Choose by lifespan: RIGHT formulas for parsing that must survive repeated imports and refreshes, Text to Columns for a one-time reshaping of a finished table, TEXTAFTER when your Excel is modern enough and the only thing you need is "everything after the delimiter".

RIGHT in Google Sheets

  • Identical syntax and defaults — every formula above pastes into Sheets unchanged.
  • Comma-decimal locales use semicolons: =RIGHT(A2; 4), exactly like Excel.
  • FIND stays case-sensitive and SEARCH stays case-insensitive with wildcard support — the pairing behaves the same.
  • For pattern-based suffixes Sheets adds REGEXEXTRACT, which can pull "everything after the last dot" in one expression instead of nesting FIND calls.

Limitations and pro tips

  • One cut per call: splitting a code into three pieces means three columns — LEFT, MID and RIGHT side by side is the classic parsing layout.
  • FIND vs. SEARCH is a deliberate choice: SEARCH for case-insensitive delimiters like a space or @, FIND when "a" and "A" must mean different targets.
  • Wrap every delimiter-driven extraction in IFERROR — a single row missing its separator otherwise spreads #VALUE! through the whole column.
  • Numbers stay text after the cut: =VALUE(RIGHT(A2, 3)) is the way back to a calculable number.
  • For the text after the nth delimiter, nest SEARCH: SEARCH("-", A2, SEARCH("-", A2) + 1) finds the second dash, and RIGHT takes from there to the end.

Think of RIGHT as the last station of a parsing line: TRIM the padding, locate the delimiter with SEARCH, measure the length with LEN, carve with RIGHT, convert with VALUE when the result is numeric. Each stage stays in its own column, so when the import format shifts next month, only one formula changes.

Related Tools

Related Functions

Frequently Asked Questions

What does the RIGHT function do in Excel?

It returns a chosen number of characters from the end of a cell: =RIGHT(A2, 4) takes the last four. With no count it takes one character, and pairing it with FIND or SEARCH plus LEN lets the cut point move with delimiters like spaces or @ signs.

How do I extract text after a space with RIGHT?

Find the delimiter and subtract: =RIGHT(A2, LEN(A2) - SEARCH(" ", A2)) takes everything after the first space. SEARCH ignores case, FIND respects it, and IFERROR around the whole thing keeps rows without the delimiter intact.

Why does RIGHT return #VALUE!?

Either the character count is negative, or an embedded FIND/SEARCH located no delimiter — FIND returns #VALUE! when the text is missing, and RIGHT inherits it. Use IFERROR with a fallback and check the rows for missing separators.

What is the difference between RIGHT and MID?

RIGHT always starts at the last character and needs only a count; MID starts wherever you say and needs both a start position and a count. RIGHT is ideal for suffixes and last names; MID handles segments buried in the middle.

Why do the numbers extracted with RIGHT not calculate?

RIGHT returns text, so its "456" is a label, not a value. Convert the result with =VALUE(RIGHT(A2, 3)) — but note that leading zeros disappear in a real number, since they only existed as text.

What happens when num_chars is larger than the text?

RIGHT simply returns the entire cell — =RIGHT("Hi", 50) is "Hi", with no error and no padding added. The same rule makes oversized counts safe for "take up to N characters" behavior.

Does RIGHT work in Google Sheets?

Yes — same name, same arguments, same FIND/SEARCH pairing and semicolon convention in comma-decimal locales. Sheets additionally offers REGEXEXTRACT for pattern-based extraction.