How do you check if multiple cells are equal?

To check if multiple cells are equal, you can use the IF function in Excel to compare the values of two cells and return a value based on the result of the comparison. You can use the IF function to compare multiple cells and make sure they all have the same value, or to compare multiple cells and ensure that at least one of them has a specific value. You can also use the COUNTIF function to check how many cells have the same value, or the COUNTIFS function to check if multiple cells have the same value.


You can use the following formula in Google Sheets to check if the values in multiple cells are equal:

=AND(ARRAYFORMULA(B2={C2,D2,E2}))

This particular formula checks if the values in cells B2, C2, D2, and E2 are all equal.

If they are all equal, the formula returns TRUE. Otherwise it returns FALSE.

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

Example: Check if Multiple Cells are Equal in Google Sheets

Suppose we have the following dataset in Google Sheets that shows the number of points scored by various basketball players during four different games:

We can type the following formula into cell F2 to check if the points values in each of the games for player A are all equal:

=AND(ARRAYFORMULA(B2={C2,D2,E2}))

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

Google Sheets check if multiple cells are equal

The formula returns TRUE if the values in all four games are equal and FALSE otherwise.

For example, player A scored 10 points in all four games so the formula returned TRUE.

However, player B did not score the same number of points in all four games so the formula returned FALSE.

If you would like to return values other than TRUE and FALSE, you can wrap the formula in an IF function.

For example, you can use the following formula to instead return the values Equal and Not Equal:

=IF(AND(ARRAYFORMULA(B2={C2,D2,E2})), "Equal", "Not Equal")

The following screenshot shows how to use this formula in practice:

The formula now returns Equal if the values in all four games are equal and Not Equal otherwise.

x