Excel RIGHT function

Summary

The Excel RIGHT function extracts a given number of characters from the right end of a text string. This function is widely used for text manipulation, particularly when you need to isolate a specific portion of text from the end of a string.
Syntax
				
					=RIGHT(text, [num_chars])
				
			
  • text: The text string from which you want to extract characters
  • num_chars: [Optional] The number of characters to extract from the right end of the text. If omitted, defaults to 1
Return value
A text string consisting of the specified number of characters from the right end of the original string.

How to use

RIGHT is ideal for text extraction and manipulation, especially when dealing with standardized text formats where the required data is located at the end of the string. It’s commonly used in data cleaning, preparation, and formatting.

Examples

Simple RIGHT
Extracting Characters from the End of a String: To get a specific number of characters from the right:
				
					=RIGHT(A1, 3)
				
			
If A1 contains “HelloWorld”, this formula returns “rld”.
RIGHT with LEN for Full Extraction
Extracting All Characters After a Specific Character: Using RIGHT with LEN to extract everything after a certain character:
				
					=RIGHT(B2, LEN(B2) - FIND("@", B2))
				
			
If B2 contains “user@example.com”, it returns “example.com”.
RIGHT and FIND for Specific Data Extraction
Extracting Domain from Email Address: Combining RIGHT and FIND to isolate the domain from an email:
				
					=RIGHT(C2, LEN(C2) - FIND("@", C2))
				
			
Pulls the domain part from an email address in C2.
RIGHT with SEARCH for Case-Insensitive Extraction
Extracting File Extension: Using RIGHT and SEARCH to get the file extension:
				
					=RIGHT(D2, LEN(D2) - SEARCH(".", D2))
				
			
If D2 contains “Report.xlsx”, it returns “xlsx”.
RIGHT in Complex String Manipulation
Isolating Last Word in a Sentence: Combining RIGHT with LEN and SEARCH to extract the last word:
				
					=RIGHT(E2, LEN(E2) - SEARCH(" ", E2, LEN(E2) - LEN(SUBSTITUTE(E2, " ", ""))))
				
			
This formula finds the last space and extracts everything after it in E2.

Additional Notes

  • RIGHT is often combined with other text functions like FIND, LEN, and SUBSTITUTE for complex text manipulations.
  • Be mindful of the num_chars value; ensure it’s within the length of the text string to avoid errors.
  • For extracting text from the beginning of a string, use the LEFT function.

Related Functions

Excel LEFT function

The Excel LEFT function extracts a specified number of characters from the start of a text string, useful for data parsing.

Excel LEN function

The Excel LEN function returns the length of a text string in characters, aiding in text data analysis and validation.

Excel MID function

The Excel MID function extracts a substring from the middle of a text string, based on start position and length, perfect for text manipulation.

Content Navigation