How to check if a cell ends with specific characters in excel?

How to check if a cell ends with specific characters in excel?

Excel provides a simple way to check if a cell ends with specific characters. We can use the RIGHT function to check for the required characters.

For example, assume that we have a list of email addresses in column A and we want to check if the email addresses end with “.com”. We can use the following formula:

=RIGHT(A1,4)=”.com”

This formula will return TRUE if the cell ends with “.com” and FALSE if it doesn’t.


You can use the following formulas in Excel to check if a cell ends with specific characters:

Formula 1: Check if Cell Ends with Specific Set of Characters

=IF(RIGHT(A2,2)="AB","Yes","No")

This particular formula checks if the last two characters in cell A2 are “AB” and returns Yes or No accordingly.

Formula 2: Check if Cell Ends with One of Several Characters

=IF(OR(RIGHT(A2,1)="A", RIGHT(A2,1)="C"),"Yes","No")

This particular formula checks if the last character in cell A2 is either “A” or “C” and returns Yes or No accordingly.

Formula 3: Check if Cell Ends with Number

=IF(ISNUMBER(VALUE(RIGHT(A2,1))), "Yes","No")

This particular formula checks if the last character in cell A2 is a number and returns Yes or No accordingly.

The following examples show how to use each formula in practice with the following list of product ID’s in Excel:

Let’s jump in!

Example 1: Check if Cell Ends with Specific Set of Characters

We can use the following formula to check if the last two characters of each cell in the Product column are equal to “AB” or not:

=IF(RIGHT(A2,2)="AB","Yes","No")

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

Excel check if cell ends with specific characters

Column B now returns “Yes” or “No” in each row to indicate if the Product ID in the corresponding cell in column A ends with “AB” or not.

Example 2: Check if Cell Ends with One of Several Characters

We can use the following formula to check if the last character of each cell in the Product column is equal to either “A” or “C”:

=IF(OR(RIGHT(A2,1)="A", RIGHT(A2,1)="C"),"Yes","No")

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

Excel check if cell ends with one of several characters

Column B now returns “Yes” or “No” in each row to indicate if the Product ID in the corresponding cell in column A ends with either “A” or “C.”

Example 3: Check if Cell Ends with Number

We can use the following formula to check if the last character of each cell in the Product column is a number or not:

=IF(ISNUMBER(VALUE(RIGHT(A2,1))), "Yes","No")

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

Excel check if cell ends with number

Column B now returns “Yes” or “No” in each row to indicate if the last character of the Product ID in the corresponding cell in column A is a number or not.

x