How do the RIGHT and RIGHTB Functions work?

  • Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel for the web, Excel 2019, Excel 2016, Excel 2019 for Mac, Excel 2013, Excel 2010, Excel 2007, Excel 2016 for Mac, Excel for Mac 2011, Excel Starter 2010. 

This post will teach you how the RIGHT and RIGHTB functions work in Microsoft Excel. It will outline their descriptions and syntaxes along with an example you can test to put your learning into practice.

A road sign symbolising the RIGHT and RIGHTB Functions.
Image by Gerd Altmann from Pixabay.


RIGHT captures the final character(s) within a text string. This is directly linked to the amount of characters you define.

RIGHTB yields the last character(s) in a text string. This is directly associated with the number of bytes you clarify.


  • These functions might only be accessible in some languages.
  • RIGHT is only compatible to be used with languages that adopt the single-byte character set (SBCS), unlike RIGHTB, which is designated to be applied with languages that employ the double-byte character set (DBCS). The standard language setting on your computer determines the return value in this way:
  • RIGHT constantly counts every character, regardless of if it is single-byte or double-byte, as 1. This is absolute despite what the preset language setting is.
  • RIGHTB counts every double-byte character as 2 after you have permitted the language editing that accepts DBCS and then define it as the automatic language. Or else, RIGHTB counts every character as 1.

The languages that support DBCS include Japanese, Chinese (Simplified), Chinese (Traditional), and Korean.

A sign that says "Next Step" to represent the RIGHT and RIGHTB Functions.

Syntax of the RIGHT and RIGHTB Functions



The RIGHT and RIGHTB functions include the specific arguments, each in their respective manner:

  • Text –   Required. The text string including your essential characters you are looking to extract.
  • Num_chars  –  Optional. Verifies the proportion of characters you prefer RIGHT to extract.
    • Num_chars has to be greater than or equal to zero.
    • If num_chars exceeds the text length, RIGHT yields the whole of text.
    • If num_chars is ignored, it is automatically presumed to be 1.
  • Num_bytes  –  Optional. Confirms the total amount of characters you seek RIGHTB to extract, dependent on bytes.
    • Num_bytes is required to be greater than or equal to zero.
    • If num_bytes is higher than the text length, RIGHT captures the entire text values.
    • If num_bytes is skipped, it is taken as 1, by default.
Image by Gerd Altmann from Pixabay.

Example of how the RIGHT and RIGHTB Functions work

Copy this example data in the below table, and paste it into cell A1 of a new, blank Excel worksheet. For formulas to present results, choose them, press F2, and then press Enter. If at any stage some of your data is partially visible then you can widen the column widths to clearly view the data in all its glory.

Sale Price
Stock Number
FormulaDescription (Result)Result
=RIGHT(A2,5)Last 5 characters of the first string (Price)Price
=RIGHT(A3)Last character of the second string (r)r

Similar Topics to Explore

How to use LEFT, LEFTB Functions

How to use the TEXT Function

Other Links

Excel Tutorial

Expand your Office skills


Got It

Get instant Excel help


Subject to Got It terms and conditions.

Leave a Reply

%d bloggers like this: