How to Use the Excel RIGHT Function to Extract Characters

Get rid of symbols, numbers, and other unwanted data

Office worker on phone in front of computer

Tim Hawley / Getty Images

In Microsoft Excel, the RIGHT function is one of several functions that extract unwanted characters from data. This is helpful because when you copy or import text into a worksheet, there sometimes may be garbage characters along with your data. Or, you may need only specific parts of the text data, such as a person's first name, but not their last name.

Here's a look at how to use the RIGHT function to remove unwanted characters in Excel.

This information applies to Excel 2019, 2016, 2013, and 2010, as well as Excel for Microsoft 365.

RIGHT Function Syntax and Arguments

In Excel, the syntax of a function refers to the layout and order of the function and its arguments. Arguments are the values functions use to perform calculations.

A function's syntax includes the function's name, parentheses, and arguments. The syntax for the RIGHT function is:

=RIGHT(Text,Num_chars)

The function's arguments tell Excel what data to look at in the function and the length of the string it should extract. Text (required) is the desired data. Use a cell reference to point out the data in the worksheet, or use the actual text in quotation marks.

Num_chars (optional) specifies the number of characters on the right of the string argument that the function should retain. This argument must be greater than or equal to zero. If you input a value that is greater than the length of the text, the function returns all of it.

If you omit the Num_chars argument, the function uses the default value of 1 character.

Removing Unwanted Text Characters

The example in the image below uses the RIGHT function to extract the term "Widget" from the longer text entry *&^%Widget located in cell B1 in the worksheet.

The function in cell C1 looks like this: =RIGHT(B1,6)

Excel spreadsheet with RIGHT function in the formula bar

Using the Function Dialog Box

To make things even simpler, select the function and arguments using the Function Dialog Box, which takes care of the syntax by entering the function's name, commas, and brackets in the correct locations and quantity.

  1. Input the data, as seen above in cell B1. Then select cell C1 to make it the active cell.

    Using your mouse to select cells helps prevent errors caused by typing in the wrong cell reference.

  2. Select the Formulas tab of the ribbon menu.

  3. Choose Text from the ribbon to open the function drop-down.

    Excel's Text formula drop-down menu with RIGHT function selected
  4. Select RIGHT in the list to bring up the Function Dialog Box.

    Excel spreadsheet with RIGHT function dialog box
  5. Select the Text line.

  6. Select cell B1 in the worksheet.

  7. Select the Num_chars line.

  8. Type in 6 on this line, since we only want to keep the six rightmost characters.

  9. Select Done to complete the function.

    Excel spreadsheet with RIGHT function dialog box
  10. The extracted text Widget should appear in cell C1. When you select cell C1, the complete function appears in the formula bar above the worksheet.

The RIGHT function extracts a certain number of characters from the right side of a text string. If the characters you want to extract are on the left side of the data, use the LEFT function to extract it. If the desired data has unwanted characters on both sides of it, use the MID function to extract it.