Use the Excel RIGHT Function to Extract Characters

Office worker on phone in front of computer

Tim Hawley/Getty Images

The RIGHT, LEFT and MID functions extract unwanted characters from data in Excel. When you copy or import text into a worksheet, it sometimes includes garbage characters along with the data you need.

There are also instances when you only need specific parts of the text data, such as a person's first name but not their last name. In cases like these, the function you use depends on where the desired data is relative to the unwanted characters in the cell.

  • If the desired data is on the right side of the data, use the RIGHT function to extract it.
  • If the desired data is 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.

Below is an example of how to use the RIGHT function to extract characters in Excel. However, you can follow the same steps to use the LEFT and MID functions.

These instructions apply to Excel 2019, 2016, 2013, 2010, and Excel for Office 365.

RIGHT Function Syntax and Arguments

In Excel, 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. You can use a  cell reference to the location of the data in the worksheet, or the actual text in quotation marks.

Num_char (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_char argument, the function uses 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.

A screenshot of Excel spreadsheet with RIGHT function in the formula bar.

The function in cell C1 looks like this: 

=RIGHT(B1,6)

Using the Function Dialog Box

To make things even simpler, you can 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.

A screenshot of Excel spreadsheet with RIGHT function dialog box.
  1. Input the data, as seen above in cell B1. Then click cell C1 to make it the active cell.

  2. Click the Formulas tab of the ribbon menu.

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

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

  5. Click the Text line.

  6. Click cell B1 in the worksheet.

  7. Click the Num_chars line.

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

  9. Click Done to complete the function.

The extracted text Widget should appear in cell C1. When you click on cell C1, the complete function appears in the formula bar above the worksheet.

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

Extracting Numbers

You can also use the RIGHT function to remove a subset of numeric data from a lengthier number. However, the function formats the extracted data as text; thus you can't use it in calculations.

One way around this problem is to use the paste special feature to convert text to numbers.