The RIGHT function is a built-in function in Excel that is categorized as a String/Text Function. It can be used as a worksheet function (WS) and a VBA function (VBA) in Excel. As a worksheet function, the RIGHT function can be entered as part of a formula in a cell of a worksheet. As a VBA function, you can use this function in macro code that is entered through the Microsoft Visual Basic Editor.
Syntax: =RIGHT(text, num_chars)
The RIGHT function syntax has the following arguments:
|text||–||The original text string.|
If omitted, the [num_chars] argument takes on the default value of 1.
Example: Let’s look at some Excel RIGHT function examples and explore how to use the RIGHT function as a worksheet function in Microsoft Excel:
Based on the Excel spreadsheet above, the following RIGHT examples would return:
- Use the RIGHT function when you want to extract characters starting at the right side of text.
- num_chars is optional and defaults to 1.
- RIGHT will extract digits from numbers as well.
- Number formatting is not part of a and will not be extracted or counted.