To compare two cells in Excel, you can use the equal operator by referring to both cells. And in the result, you will get TRUE if both values are the same and if the values are not the same you will get FALSE in the result.

In the following example, we have two values in the cells A1 and B1 respectively, and now, you need to compare both cells.

In this tutorial, we will learn about the different methods that you can use.

## Compare Two Cells using Equals Operator

- First, in cell C1, enter the equal operator to start the formula.
- After that, refer to cell A1 where we have the first values.
- Next, enter the equal operator to compare values from the cells.
- Now, refer to cell B1 where you have the second value.
- In the end, hit enter to get the result.

As you can see, in the result, we have FALSE which means both values in the cells are not the same. But if you change the value in cell B1 to “Yes”, you will get TRUE in the result.

So, this is a simple and quick way to compare two cells and get the result as TRUE or FALSE.

`=A1=B1`

## Using EXACT Function to Match Text Values from Two Cell

There’s also a function in Excel that you can use, and that’s EXACT. With the EXACT function, match text values from two cells and you can refer to the cells that you want to compare, and it will return TRUE or FALSE in the result.

We are using the same example:

- First, in cell C1, enter the EXACT function.
- After that, refer to cell A1.
- Next, enter a comma.
- Now, refer to cell B1.
- In the end, enter the closing parentheses and hit enter to get the result.

You can see we have got FALSE in the result as values in cells A1 and B1 are not the same.

`=EXACT(A1,B1)`

## Using the IF Function Create a Condition to Compare Two Values

In both methods that we have discussed above, we get the result in TRUE or FALSE, but, what if you want to have a custom result for both cases? In that case, you can use the IF function to create a condition and get a custom result.

- First, in cell C1, enter the IF function.
- After that, use the same way to compare cells that we have used in the first method.
- Next, in the second argument of the function, enter the value that you want to get if both values match.
- Now, in the third argument of the function, enter the value that you want to get if both values do not match.
- In the end, enter the closing parentheses and close the function.

As you can see, in the result we have the value “Not Matched” as values in both of the cells are not the same.

`=IF(A1=B1,"Matched","Not Matched")`