Excel: A Formula for RIGHT Until Specific Character

Excel is a powerful tool for data analysis and information management. It is widely used in business and academia for various tasks, such as budgeting, forecasting, and gaining insights from data. One of the most useful features of Excel is its ability to use formulas to manipulate data. One particular formula that can be used for data manipulation is the RIGHT function. The RIGHT function allows you to extract a specific number of characters from the right side of a text string. This can be especially useful when dealing with large data sets, as it can quickly and easily extract the exact information you need from the data. In this article, we will explore how to use the RIGHT function to extract a specific number of characters from the right side of a text string. With this formula, you can easily extract the exact data you need, saving you time and increasing your productivity.


You can use the RIGHT function in Excel to extract a certain number of characters from the right side of a string.

If you’d like, you can use the following formula to use the RIGHT function to extract all characters from the right side of a string until a specific character is encountered: 

=RIGHT(A2,LEN(A2)-SEARCH("^",SUBSTITUTE(A2,"_","^",LEN(A2)-LEN(SUBSTITUTE(A2,"_","")))))

This particular example extracts all of the characters on the right side of the string in cell A2 until an underscore is encountered.

The following example shows how to use this formula in practice.

Example: Using RIGHT Until Specific Character in Excel

Suppose we have the following list of basketball team names in Excel:

We can type the following formula into cell B2 to extract all of the characters on the right side of the team name of cell A2 until an underscore is encountered:

=RIGHT(A2,LEN(A2)-SEARCH("^",SUBSTITUTE(A2,"_","^",LEN(A2)-LEN(SUBSTITUTE(A2,"_","")))))

We can then click and drag this formula down to each remaining cell in column B:

Column B now displays all of the characters on the right side of each cell in column B until an underscore is encountered.

Notice that if multiple underscores are present in a cell, the formula is capable of identifying the last underscore and extracts only the characters to the right of it.

It’s worth noting that if no underscore is found in the Team name, the formula will return #VALUE! as a result.

To return a different value, simply use the IFERROR() function.

For example, we can use the following IFERROR() function to return “None Found” if an underscore is not found in a given team name:

=IFERROR(RIGHT(A2,LEN(A2)-SEARCH("^",SUBSTITUTE(A2,"_","^",LEN(A2)-LEN(SUBSTITUTE(A2,"_",""))))), "None Found")

Note that you can also return a different value by simply replacing “None Found” with some other value in the IFERROR() function.


In conclusion, the RIGHT function in Excel can be used to extract a certain number of characters from the right side of a string. This example demonstrates how to use the RIGHT function to extract all characters from the right side of a string until a specific character is encountered. This can be a useful tool for extracting specific information from data sets. Additionally, the IFERROR() function can be used to return a different value if no underscore is found in a given team name.

x