# How to Check if Two Values Are Equal in Excel

3 months ago

Yes, you tin show if 2 numbers are adjacent successful an instant conscionable by looking astatine them. But that won't beryllium nan lawsuit erstwhile you're looking astatine larger numbers aliases if you want to trial aggregate numbers successful 2 columns to spot if they're equal.

Like everything else, Excel has a remedy that makes this trial easier. There are galore formulas you could constitute that cheque if 2 values successful Excel are adjacent aliases not. The simplest methods are utilizing an expression, nan DELTA function, and nan IF function.

## 1. Test if Two Values Are Equal With an Expression

The easiest measurement to find whether 2 cells are adjacent is by utilizing a elemental Boolean expression. This way, you tin get nan occupation done pinch a elemental logical usability without utilizing immoderate Excel functions.

1. Select nan compartment wherever you want to show nan results.
2. In nan look bar, participate nan look below: =A1=B1
3. Press Enter.

If nan look is existent and A1 equals B1, Excel will return TRUE. Otherwise, it will return FALSE. That's it! This method is extraordinarily elemental since it doesn't usage immoderate functions. However, for nan aforesaid reason, it's not suitable for analyzable calculations arsenic you can't harvester it pinch different functions.

## 2. Test if Two Values Are Equal With nan DELTA Function

DELTA is an Excel usability that tests whether 2 numerical values are equal. Similar to utilizing an expression, nan DELTA usability has 2 preset outputs. If nan 2 values are equal, DELTA will return 1; if they are not, it will return 0.

=DELTA(number1, number2)

The DELTA usability tin only run connected numbers and cannot trial whether 2 matter strings are equal. If number2 is near blank, DELTA will presume that it is zero.

### Count Equal Values With nan DELTA Function

DELTA tin beryllium easy coupled pinch different Excel functions to count nan adjacent number pairs successful a list. In this sample spreadsheet, we person 2 columns of numbers, and we want to spot really galore pairs are equal.

For this example, we will usage nan DELTA usability to cheque if nan numbers successful each brace are equal. Then, we will get nan count of adjacent pairs utilizing Excel's COUNTIF function. Here's how:

1. Select nan first compartment successful nan file wherever you want to cheque if nan numbers are equal. In this example, we'll usage compartment C2.
2. In nan look bar, participate nan look below: =DELTA(A2, B2)
3. Press Enter.

DELTA will now show you if nan 2 numbers are adjacent aliases not. The look calls DELTA to trial nan numbers successful A2 and B2 and spot if they're equal. The look past returns 1 to bespeak that they were equal. If nan 2 numbers weren't equal, nan look would return 0.

Grab nan capable grip and driblet it connected nan cells beneath to get nan trial results for each nan numbers. Now, you tin spot which pairs person adjacent numbers utilizing nan DELTA function. Unfortunately, that's arsenic acold arsenic nan DELTA usability goes. You'll person to usage Excel's COUNT function to count nan number of pairs pinch adjacent numbers. One campaigner for this task is nan COUNTIF function.

COUNTIF tin spell done a scope of cells and return nan number of cells that meet a circumstantial condition. Since DELTA returned 1 to bespeak adjacent pairs, you tin inquire COUNTIF to spell done DELTA's output and count nan cells containing 1. This will return nan number of adjacent pairs.

1. Select nan compartment wherever you want to show nan count of pairs pinch adjacent numbers.
2. In nan look bar, participate nan look below: =COUNTIF(C2:C10, "=1")
3. Press Enter.

The look calls connected COUNTIF to cheque nan results from nan DELTA usability (C2 to C10) and return nan number of cells that adjacent 1. Remember that nan DELTA usability returns 1 erstwhile nan 2 values are equal; therefore, this look will count nan number of pairs pinch adjacent numbers. In nan formula, you tin switch 1 pinch 0 to get nan count of pairs pinch unequal numbers.

The DELTA usability is simply a elemental capable method to cheque if 2 numbers are equal. However, if you don't for illustration nan binary output of nan DELTA function, you tin usage nan IF usability alternatively to get a civilization output.

## 3. How to Test if Two Values Are Equal With nan IF Function

IF is 1 of Excel's logical functions. It takes a information and past returns a user-specified output based connected whether nan information is met.

=IF(logical_Test, Output_If_True, Output_If_False)

The IF usability conducts a logical test, and if nan trial consequence is true, it returns Output_If_True. Otherwise, it returns Output_If_False.

IF is successful a full different convention than DELTA. Where DELTA could only find whether 2 numbers are equal, IF allows you to usage Excel's logical operators to tally immoderate benignant of test. However, successful this context, nan IF usability useful successful nan aforesaid measurement arsenic nan DELTA function, isolated from that you tin person it output a circumstantial string.

To cheque if 2 values are adjacent pinch nan IF function, you request to tally a logical trial wherever you put nan 2 cells arsenic equal. Then, you'll request to specify outputs for nan 2 scenarios: The trial consequence being true, and nan trial consequence being false.

=IF(A1=B1, "Yes", "No")

For example, nan supra look checks whether A1 equals B1, past returns Yes aliases No depending connected nan results.

Another advantage of IF complete DELTA is that it isn't restricted to numbers and useful pinch matter strings, too. You tin moreover use aggregate IF functions together to specify aggregate conditions.

### Count Equal Values With nan IF Function

Let's put nan IF usability to usage successful nan aforesaid example. The extremity is to spot which number pairs are adjacent and past count nan adjacent ones utilizing nan COUNTIF function.

1. Select nan first compartment successful nan file wherever you want to return nan trial results. This will beryllium compartment C2 for this example.
2. In nan look bar, participate nan look below: =IF(A2=B2, "Yes", "No")
3. Press Enter.

The IF usability will now show you whether nan 2 values are adjacent aliases not. The look present tests cells A2 and B2 to spot if they're equal. If nan 2 cells are equal, nan look will return Yes. Otherwise, nan look will return No.

Grab nan capable grip and driblet it connected nan cells below. The IF usability will now trial each brace and return nan results accordingly.

You tin count nan adjacent pairs utilizing nan COUNTIF usability successful nan aforesaid measurement arsenic nan DELTA function. The only quality is that alternatively of counting nan cells that adjacent 1, you should count nan cells containing nan drawstring Yes. This is because nan IF look you wrote returns Yes for pairs pinch adjacent values.

Here's really you tin count nan adjacent pairs:

1. Select nan compartment wherever you want to return nan count. For this example, we've chosen compartment E2.
2. In nan look bar, participate nan look below: =COUNTIF(C2:C10, "=Yes")
3. Press Enter.

COUNTIF will now show you really galore pairs incorporate adjacent values. The look summons COUNTIF to look done nan IF results (C2 to C10) for cells containing nan drawstring Yes and past returns nan count of cells that do. Since IF returned Yes for adjacent pairs, this will beryllium nan count of adjacent pairs.

## Test if Two Values Are Equal With Excel Functions

There are plentifulness of formulas you could constitute up to cheque whether 2 values are adjacent successful Excel. The astir straightforward attack is to constitute nan look arsenic a Boolean. If you want to usage functions, nan DELTA usability exclusively serves this purpose, whereas nan IF usability tin execute galore feats, including this one.

Now that you cognize really to usage Excel to cheque if 2 cells are equal, you tin hide astir going done nan cells yourself. Excel exists to return nan load of counting and calculating disconnected your shoulders. This is 1 insignificant lawsuit of really Excel tin do that and make your life easier.

Source Tutorials