How to check if two values ​​are equal in Excel

In Excel, you have many formulas to help determine whether two values ​​are equal. The DELTA function in Excel will help you do this easily.

In Excel, you have many formulas to help determine whether two values ​​are equal. The DELTA function in Excel will help you do this easily.

 

Picture 1 of How to check if two values ​​are equal in Excel

What is the Delta function in Excel?

 

Delta is an Excel function that checks if two numerical values ​​are equal. If they are equal, DELTA returns 1; otherwise, it returns 0.

=DELTA(number1, number2)

The DELTA function only calculates numerical values, and if number2 is empty, this Excel function defaults to 0.

How to check for equality between two values ​​using the DELTA function.

The example below has two columns of numbers, and you want to know how many pairs of numbers are equal. Here, you would use the DELTA function to check if the numbers in each pair are equal. Then, count the number of equal pairs using the COUNTIF function. Here's how to do it:

Picture 2 of How to check if two values ​​are equal in Excel

 

1. Select the first cell in the column you want to check. In this example, it's cell C2.

2. In the formula bar, enter:=DELTA(A2, B2)

3. Press Enter . DELTA will now tell you whether the two numbers are equal.

4. Drag the fill bar and drop it into the box below to get the result for all the numbers.

Picture 3 of How to check if two values ​​are equal in Excel

The DELTA function checks the numbers in A2 and B2 and finds they are equal. The formula returns 1. If the two numbers are not equal, the formula returns 0.

Now you can see the pairs of equal numbers. Next, to count the number of equal pairs, you have to use the COUNTIF function. Since DELTA returns 1 to indicate each equal pair, you can have the COUNTIF function pass in the DELTA output and count the cells containing 1.

1. Select the cell where you want to display the number of pairs of equal numbers.

2. In the formula bar, enter: =COUNTIF(C2:C10, "=1").

3. Press Enter .

This formula will call COUNTIF to check cells C2 through C10 (results from the DELTA function and return a cell number equal to 1).

Picture 4 of How to check if two values ​​are equal in Excel

Above is how to check and count identical numbers in Excel. Hopefully, this article is helpful to you.

« PREV POST
READ NEXT »