The RIGHT function in Excel allows you to extract a specified number of characters from the right (end) of a text string. ✂️ For example, =RIGHT(A1, 3)
returns the last three characters of the value in cell A1. This is incredibly useful when you’re working with codes, dates, serial numbers, file names, and more. Whether you’re on Windows, macOS, or Ubuntu, the RIGHT function helps clean, transform, and analyze data efficiently. 💼
🔍 What Does the RIGHT Function Do in Excel?
The RIGHT
function returns a substring from the end of a text string, based on the number of characters you specify.
Syntax:
=RIGHT(text, [num_chars])
text
: The original string or cell reference (e.g.,"Excel"
orA1
)num_chars
: Optional. The number of characters to extract from the right (default is 1)
✏️ Examples of the RIGHT Function
Formula | Output | Explanation |
---|---|---|
=RIGHT("Excel", 2) | el | Returns last 2 characters |
=RIGHT("2024-04-18", 2) | 18 | Extracts the day |
=RIGHT(A2, 4) | 1234 | Gets last 4 digits of a number in A2 |
=RIGHT(B1, LEN(B1)-6) | Removes first 6 characters | Dynamic trimming |
💡 When to Use the RIGHT Function
Use RIGHT when you need to:
- Extract last names, suffixes, or file extensions
- Get the last n digits of product codes
- Pull the day from a full date text
- Clean up imported or unstructured data
- Work with fixed-length data fields
⚙️ Keyboard Shortcuts for RIGHT Function
Task | Windows | macOS | Ubuntu (LibreOffice Calc) |
---|---|---|---|
Start a formula | = | = | = |
Insert function dialog | Shift + F3 | Shift + F3 | Ctrl + F2 |
Accept formula | Enter | Return | Enter |
Expand formula bar | Ctrl + Shift + U | Cmd + Shift + U | Ctrl + Shift + U |
Tip: After typing =RIGHT(
, press Ctrl + A
to open the argument input helper box.
🧩 Combine RIGHT with Other Excel Functions
- RIGHT + LEN: Remove prefix of known length
=RIGHT(A1, LEN(A1)-3)
- RIGHT + FIND: Extract dynamic text like file extensions
=RIGHT(A1, LEN(A1) - FIND(".", A1))
- RIGHT + VALUE: Convert extracted numbers to actual values
=VALUE(RIGHT(A2, 4))
🐧 RIGHT Function in Ubuntu/Linux (LibreOffice Calc)
LibreOffice Calc supports the RIGHT function the same way as Excel:
=RIGHT(A1, 3)
- Extracts the last 3 characters from the cell
- Use
Ctrl + F2
to open the Function Wizard - Category: Text functions
📊 Real-World Examples of Using RIGHT
Use Case | Formula | Result |
---|---|---|
Last 4 digits of SSN | =RIGHT(B2, 4) | 6789 |
Get file extension | =RIGHT(A2, 3) | jpg |
Extract date suffix | =RIGHT("2024-04-18", 2) | 18 |
Truncate left-side ID prefix | =RIGHT(A1, LEN(A1)-2) | Removes first 2 characters |
🎨 Pro Tip: Wrap Text Output in CONCAT or IF
="Ref Code: " & RIGHT(A2, 4)
Or conditionally format:
=IF(RIGHT(A1, 3)="PDF", "Document", "Other")
This enhances your reporting and labeling with dynamic text logic. 🔁
⚠️ Common Mistakes with RIGHT Function
- ❌ Forgetting
num_chars
— defaults to 1 - ❌ Using
RIGHT
with numbers that aren’t formatted as text - ❌ Miscalculating
LEN()
when trimming dynamically - ❌ Trying to extract more characters than the string contains (returns full string instead)
✅ Solution: Use LEN(A1)
to help calculate accurate lengths dynamically!
FAQs
What is the RIGHT function used for in Excel?
It extracts a specified number of characters from the end of a text string.
Can RIGHT be used with numbers?
Yes, but numbers should be formatted as text or wrapped with TEXT()
if needed.
Is RIGHT case-sensitive?
No. It simply pulls characters; it doesn’t change or check case.
Can I combine RIGHT with other functions?
Absolutely! Pair it with LEN()
, FIND()
, IF()
, VALUE()
, and CONCAT()
.
Is RIGHT available in Google Sheets and LibreOffice Calc?
Yes! The syntax is identical in both.
What happens if I don’t specify num_chars
?
Excel will return only the last character of the string.
✅ Final Thoughts on Excel RIGHT Function
The RIGHT function in Excel is a powerful tool for extracting data from the end of any text string—cleanly, quickly, and dynamically. 📥 Whether you’re dealing with part numbers, codes, or name suffixes, using =RIGHT()
lets you break down your data with precision and clarity.
Pair it with LEN()
, FIND()
, and other functions to build smarter formulas—and your Excel sheets will be sharper, faster, and more accurate than ever. 🚀
Complete List of Windows Keyboard Shortcuts
If you need help for Windows, you can find a whole list of all keyboard shortcuts here.
https://keyboard-shortcuts.org/
Advertisment