RIGHT function

RIGHT returns the specified number of characters from the end of a text string, defaulting to one character if omitted.

=RIGHT(text, [num_chars])

Generate a RIGHT formula

Describe what you need. The generator will reach for RIGHT where RIGHT is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How RIGHT reads its arguments
textrequirednum_charsoptionalRIGHT
ArgumentRequiredDescription
textRequiredThe source value to extract from; can be a string, a cell reference, or any value that can be coerced to text.
num_charsOptionalOptional number of characters to return; must be a non-negative integer, defaults to 1, and produces an error if negative or non-numeric.

Returns

A single text string containing the rightmost characters.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Extract ZIP code from address

AddressBedsBathsList PriceDays on Market
123 Maple St Apt 4B, Springfield, IL 627043225000045d
=RIGHT(A2,5)

Result: 62704

The address in A2 ends with the five-digit ZIP code "62704". By asking RIGHT to return the last five characters, the function slices exactly that portion. Because the ZIP code is already at the end of the string, no additional trimming is needed. The result is returned as text, preserving any leading zeros that might appear in other ZIP codes.

2. Show the final two digits of the list price

AddressBedsBathsList PriceDays on Market
456 Oak Ave, Lincoln, NE 685084337500030d
=RIGHT(D2,2)

Result: 00

List prices are numeric, but RIGHT first coerces the number 375000 to the text "375000". Requesting the last two characters therefore yields "00", which can be useful for quick visual checks of round-off patterns. The function does not perform any arithmetic; it merely treats the number as a string. The output remains a text string, not a numeric value.

3. Identify the trailing unit in days on market

AddressBedsBathsList PriceDays on Market
789 Pine Rd, Madison, WI 537032119950012d
=RIGHT(E2,1)

Result: d

The Days on Market column stores values like "12d" where the trailing "d" denotes days. Using RIGHT with a single character extracts that suffix, confirming the unit used in the sheet. This technique is handy when the same column mixes numbers and letters and you need to isolate the non-numeric part. The result "d" can then be combined with other functions for further processing.

Common errors

Which RIGHT error are you seeing?
RIGHT returned an error#VALUE!
Replace the negative value with a positive integer or omit the argument to default to 1.
#VALUE!
Provide a numeric value, or wrap the text in VALUE() to coerce it to a number.
#N/A
Ensure the source cell contains valid text or protect the formula with IFERROR(A3, "") before applying RIGHT.
ErrorWhy it happensHow to fix it
#VALUE!The num_chars argument was negative (e.g., =RIGHT(A2,-3)), which RIGHT does not accept.Replace the negative value with a positive integer or omit the argument to default to 1.
#VALUE!The num_chars argument was non-numeric text such as "two" (e.g., =RIGHT(A2,"two")).Provide a numeric value, or wrap the text in VALUE() to coerce it to a number.
#N/AThe text argument referenced a cell that already contains the #N/A error (e.g., =RIGHT(A3,5) where A3 is #N/A).Ensure the source cell contains valid text or protect the formula with IFERROR(A3, "") before applying RIGHT.

Tips and when to use something else

  • When you need characters from the start of a string, use LEFT instead of RIGHT.
  • Combine RIGHT with FIND to pull everything after a known delimiter, such as the part after the last space in an address.
  • RIGHT automatically treats numbers as text, so leading zeros in numeric codes will be preserved only if the original value is stored as text.
  • If the number of characters to extract varies, reference another cell containing that count and wrap it with NUMBERVALUE to avoid type-mismatch errors.

Frequently asked questions

How do I pull the ZIP code from an address column in my real-estate sheet?
Use RIGHT on the address cell with 5 as the num_chars argument, e.g., =RIGHT(A2,5). This returns the final five characters, which in a standard US address are the ZIP code. Ensure the address ends with the ZIP and not extra spaces.
Why does RIGHT give me #VALUE! even though I entered a positive number?
RIGHT returns #VALUE! if the num_chars argument is negative or cannot be interpreted as a number. Double-check that the argument is a plain integer without quotes or stray characters. If the count is stored in another cell, make sure that cell contains a numeric value.
Can RIGHT work directly on numeric list prices without converting them first?
Yes. RIGHT will coerce a numeric value to text before extracting characters, so you can apply it to a price like 375000. The result will be a text string, not a number, which matters if you plan to use the output in further arithmetic calculations.
What if the number of characters I need to extract is stored in another column?
Reference that cell in the num_chars argument, for example =RIGHT(A2,F2). If the referenced cell might contain text, wrap it with VALUE() or NUMBERVALUE() to guarantee a numeric count. This makes the formula dynamic and adaptable to varying lengths.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17