X
Excel Zero to Hero Interactive Learning Platform
0%
text

RIGHT Function

beginner

RIGHT Function

🎯Purpose

Returns the last character or characters in a text string, based on the number of characters you specify.

Syntax

EXCEL
=RIGHT(text, [num_chars])

Arguments Breakdown

Argument Required? Description
text Required The text string that contains the characters you want to extract.
num_chars Optional The number of characters to extract from the right side (defaults to 1 if omitted).

Practical Examples

1. Extract Trailing Characters Drill

From Formulas_&_Functions_Part_1.xlsx: If A1 contains "Mostafa":

EXCEL
=RIGHT(TRIM(A1), 4)

Result: "tafa".

2. Extract Numerical Serial from Superstore Order ID

In Superstore dataset: Order ID = "CA-2016-152156"

EXCEL
=RIGHT([@[Order ID]], 6)

Result: "152156".

3. Dynamic Last Name Extraction

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

Behavior Rules

  • num_chars must be $\ge 0$.
  • If num_chars is greater than the total length of text, RIGHT returns all of text.

Related Knowledge

← Back to Formula Library