Quick Navigation
RIGHT & RIGHTB Functions
Summary
The RIGHT function extracts specified number of characters from the end of a text string. RIGHTB does the same but counts bytes instead of characters, designed for double-byte character sets like Japanese.
Syntax
RIGHT(text, [num_chars])
RIGHTB(text, [num_bytes])
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | Text |
Yes | Text string containing characters to extract from the end |
| num_chars | Number |
No | Number of characters to return (omit for 1) |
| num_bytes | Number |
No | Number of bytes to return for RIGHTB (omit for 1) |
Using the RIGHT, RIGHTB Function
RIGHT and RIGHTB are essential for text manipulation, particularly when you need the last few characters of strings like product codes, dates, or file extensions. RIGHT works with standard characters while RIGHTB handles multi-byte characters.
Common RIGHT, RIGHTB Examples
Extract File Extension
=RIGHT(A2,4)
From 'report.xlsx' returns 'xlsx'
Get Last Name
=RIGHT(B2, LEN(B2)-FIND(" ",B2))
From 'John Doe' returns 'Doe'
Last 3 Characters Default
=RIGHT(C2)
From 'Hello' returns 'o'
RIGHTB for Multi-byte
=RIGHTB(D2,4)
Extracts 4 bytes from double-byte text
Frequently Asked Questions
Common Errors and Solutions
#VALUE! error
Cause: num_chars is negative
Solution: Use zero or positive number >=0
Unexpected results with DBCS
Cause: Using RIGHT instead of RIGHTB
Solution: Use RIGHTB for double-byte languages
Notes
- num_chars must be >= 0
- RIGHTB is deprecated but still functional
- RIGHT now supports Unicode in modern Excel
- Combine with LEN for dynamic extraction
Compatibility
Available in: Excel 2007+, Excel 2010+, Excel 2013+, Excel 2016+, Excel 2019+, Excel 365
Not available in:
Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 2007+, Excel 2010+, Excel 2013+, Excel 2016+, Excel 2019+, Excel 365