RIGHT Function

Returns a set number of characters from the end of a text value.

Category

Text

Available in

All versions, Microsoft 365

Returns

Text

Taught hands-on in Level 3: Intermediate Lookups & Data Summaries - Text Functions module

Overview

RIGHT is LEFT's mirror image: it pulls characters from the end of the text.

Use it for suffixes — the last four digits of an account, a size code, a file extension — and with LEN and FIND for “everything after the space”.

Syntax

=RIGHT(text, [num_chars])

Arguments

ArgumentRequired?What it does
textYesThe text (or cell) to take characters from.
num_charsOptionalHow many characters to return from the end. Leave it out and you get 1.

Examples

Example 1 — Last four digits of an account

Show only the last four digits of each account number on a customer letter.

B2fx=RIGHT(A2, 4)
AB
1AccountLast 4
2ACCT-551209340934
3ACCT-880133773377
4ACCT-102045614561
=RIGHT(A2, 4) Explain

The leading zero in 0934 survives because RIGHT returns text.

Example 2 — Last name after the space

Take everything after the space: the total length minus the space's position.

B2fx=RIGHT(A2, LEN(A2)-FIND(" ", A2))
AB
1Full nameLast name
2Ana LopezLopez
3Benjamin ChoCho
4Cara SinghSingh
=RIGHT(A2, LEN(A2)-FIND(" ", A2)) Explain
  1. LEN(A2) counts every character — 9 for “Ana Lopez”.
  2. FIND(" ", A2) is the space's position — 4.
  3. 9 − 4 = 5, so RIGHT returns the last five characters: “Lopez”.
Names with a middle name break this. =TEXTAFTER(A2, " ", -1) always takes the text after the last space.

Common mistakes

  • Numbers lose their format. RIGHT works on the underlying value, not what you see. =RIGHT(A2,2) on a cell showing $1,250.00 returns "50" because the value is 1250.

Notes

Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.