Excel for not equal to

Not Equal To in Excel

Excel Not Equal To (Table of Contents)

  • Not Equal To in Excel
  • How to Put ‘ Not Equal To ‘ in Excel?

Not Equal To in Excel

Not Equal To generally is represented by striking equal sign when the values are not equal to each other. But in Excel, it is represented by greater than and less than operator sign “<>” between the values which we want to compare. If the values are equal, then it used the operator will return as TRUE, else we will get FALSE. We can use the Not Equal operator along with other conditional functions as IF, SUMIF, COUNTIF function to get some other kind of meaning of results.

How to Put ‘ Not Equal To ‘ in Excel?

Not Equal To in Excel is very simple and easy to use. Let’s understand the working of Not Equal To Operator in Excel by some examples.

You can download this Not Equal To Excel Template here – Not Equal To Excel Template

Example #1 – Using ‘ Not Equal To Excel ‘ Operator

In this example, we are going to see how to use the Not Equal To logical operation <> in excel.

Consider the below example, which has values in both the columns now; we are going to check the Brand MRP of Amazon and Flipkart.

Not Equal To Example 1-1

Now we are going to check that Amazon MRP is not equal to Flipkart MRP by following the below steps.

  • Create a new column.

Not Equal To Example 1-2

  • Apply the formula in excel as shown below.

Not Equal To Example 1-3

  • So as we can see in the above screenshot, we applied the formula as =B3<>C3 here, we can see that in the  B3 column Amazon MRP is 1400, and Flipkart MRP is 1400, so the MRP matches exactly.
  • Excel will check if B3 values are not equal to C3, then it returns TRUE or else it will return FALSE.
  • Here in the above screenshot, we can see that Amazon MRP is equal to Flipkart MRP, so we will get the output as FALSE, which is shown in the below screenshot.

Not Equal To Example 1-4

  • Drag down the formula for the next cell. So the output will be as below:

Not Equal To Example 1-5

  • We can see that the formula =B4<>C4; in this case, Amazon MRP is not equal to Flipkart MRP. So excel will return the output as TRUE, as shown below.

Not Equal To Example 1-6

Example #2 – Using String

In this excel example, we are going to see how not equal to excel operator works in strings. Consider the below example, which shows two different titles named for Amazon and Flipkart.

Not Equal To Example 2-1

Here we will check that Amazon’s title name matches the Flipkart title name by following the below steps.

  • First, create a new column called Output.

Not Equal To Example 2-2

  • Apply the formula as =A2<>B2.

Not Equal To Example 2-3

  • So the above formula will check for A2 title name is not equal to B2 title name if it is not equal, it will return FALSE or else it will return TRUE as we can see that both the title names are the same and it will return the output as FALSE which is shown in the below screenshot.

Not Equal To Example 2-4

  • Drag down the same formula for the next cell. So the output will be as below:

Not Equal To Example 2-5

  • As =A3<>B3, where we can see the A3 title is not equal to the B3 title, so we will get the output as TRUE which is shown as the output in the below screenshot.

Not Equal To Example 2-6

Example #3 – Using IF Statement

In this excel example, we are going to see how to use the if statement in the Not Equal To operator.

Consider the below example, where we have title names of both Flipkart and Paytm, as shown below.

Not Equal To Example 3-1

Now we are going to apply the Not Equal To Excel operator inside the if statement to check both the title names are equal or not equal by following the below steps.

  • Create a new column as Output.

Not Equal To Example 3-2

  • Now apply the if condition statement as follows =IF(A2<>B2, “Title Not Matching”, “Title Matching”)

Using IF formula Example 3-3

  • Here in the if condition, we used not equal to Operator to check whether the title is equal to or not equal.
  • Moreover, we have mentioned in the if condition in double-quotes as “Title Not Matching”, i.e., if it is not equal to it, it will return as “Title Not Matching”, or else it will return “Title Matching”, as shown in the below screenshot.
  • As we can see that both the title names are different, and it will return the output as Title Not Matching which is shown in the below screenshot.

Using IF formula Example 3-4

  • Drag down the same formula for the next cell.

Not Equal To Example 3-5

  • In this example, we can see that the A3 title is equal to the B3 title; hence we will get the output as “Title Matching “, which is shown as the output in the below screenshot.

Result of Example 3-6

Example #4 – Using the COUNTIF Function

In this excel example, we are going to see how the COUNTIF Function works in the Not Equal To operator.

Consider the below example, which shows student’s subject marks along with the grade.

Not Equal To Example 4-1

Here we are going to count how many students have taken the marks in it equal to 94 by following the below steps.

  • Create a new row named as Marks Not Equal To 50.

Not Equal To Example 4-2

  • Now apply the COUNTIF formula as =COUNTIF(C2:C7,”<>50″)

Using COUNTIF formula Example 4-3

  • As we can see in the above screenshot, we have applied the COUNTIF function to find out Student marks not equal to 50. We have selected the cells C2:C7, and in the double quotes, we have used <> not equal to Operator and mentioned the number 50.
  • The above formula counts the student’s marks which is not equal to 50, and return the output as 5, as shown in the below result.
  • In the below screenshot, we can see that marks not equal to 50 are 5, i.e. Five students scored marks more than 50.

Using COUNTIF formula Example 4-4

  • Now we will use a string to check the student’s grade stating how many students are not equal to the grade “Very Good”, which is shown in the below screenshot.

Not Equal To Example 4-5

  • For this, we can apply the formula as =COUNTIF(D2:D7,”<>”& A9).

Using COUNTIF formula Example 4-6

  • So this COUNTIF function will find the student’s grade from the range we have specified D2:D7 using the Not Equal To Excel OPERATOR. The grade variable “VERY GOOD” has been concatenated by the operator “&” by specifying A9. Which will give us the result of 3, i.e. 3 students grade are not equal to “Very Good” which is shown in the below output.

Using COUNTIF formula Example 4-7

Things to Remember About Not Equal To in Excel

  • In Microsoft excel, logical operators mostly used in conditional formatting, which will give us the perfect result.
  • Not Equal To operator always requires at least two values to check either it is “TRUE” or “FALSE”.
  • Make sure that you are giving the correct condition statement while using the Not Equal To the operator, or else we will get an invalid result.

Recommended Articles

This has been a guide to Not Equal To in Excel. Here we discuss how to put Not Equal To in Excel along with practical examples and a downloadable excel template. You can also go through our other suggested articles –

  1. Formatting Text in Excel
  2. Add Rows in Excel Shortcut
  3. COUNTIF Excel Function
  4. SUMIF Function in Excel

What is “Not Equal To” Sign in Excel?

The “not equal to” is a logical operator in excel that helps compare two numerical or textual values. It is written (like <>) using a pair of angle brackets pointing away from each other. The “not equal to” excel sign returns either of the two Boolean values (true and false) as the outcome

  • True implies that the two compared values are different or not equal.
  • False implies that the two compared values are the same or equal.

For example, “=2<>4” (ignore the double quotation marks) returns “true” since the numbers 2 and 4 are not equal to each other.

The “not equal to” is used in the arguments of several Excel functions. The purpose of using the “not equal to” is to assess whether two values are different or not. However, the magnitude of difference is not conveyed by this operator.

Table of contents
  • What is “Not Equal To” Sign in Excel?
    • How is the “Not Equal To” Sign Used in Excel?
      • Example #1–Compare two Numeric Values with the “Not Equal To” Operator
      • Example #2–Compare two Textual Values with the “Not Equal To” Operator
      • Example #3–Obtain Defined Results with the IF Function and the “Not Equal To” Condition
      • Example #4–Count Specific Cells with the COUNTIF Function and the “Not Equal To” Condition
      • Example #5–Sum Particular Cells with the SUMIF Function and the “Not Equal To” Condition
    • The Key Points Related to the “Not Equal To” Operator of Excel
    • Frequently Asked Questions
    • Recommended Articles

How is the Not Equal To” Sign Used in Excel?

Let us consider some examples to understand the working of the “not equal to” operator in Excel.

You can download this Not Equal to Excel Template here – Not Equal to Excel Template

Example #1–Compare two Numeric Values with the “Not Equal To” Operator

The succeeding image shows the marks of students A and B (columns A and B) in 10 subjects. The total marks of each subject are 200. We want to find those rows for which the marks of the two students are unequal. Use the “not equal to” signof Excel.

The steps to find if a difference exists between the two marks are listed as follows:

Step 1: In cell C3, type the “equal to” symbol followed by the cell reference B3. Since the difference between cells B3 and A3 needs to be assessed, insert the “not equal to” sign between these two cell references.

The formula should look like the expression “=B3<>A3.” This expression is also known as a statement or a condition.

Note: A condition in Excel is an expression that evaluates to either true or false. At a given time, a condition cannot be assessed as both true and false.

Not Equal to Excel Method 1

Step 2: Press the “Enter” key. The output in cell C3 is “true.” This is shown in the following image.

Not Equal to Excel Method 1-1

Step 3: Drag the formula of cell C3 till cell C12 by using the fill handle. This is shown in the following image.

Not Equal to Excel Method 1-2

Step 4: The outputs for the entire column C are shown in the following image. The outputs which are false have been colored yellow. The inferences from this dataset are stated as follows:

  1. If the output is “true,” the values of column A and column B for a given row are not equal. This means that the “not equal to” excel condition for that particular row is met. For instance, the “not equal to” condition for row 3 is “=B3<>A3.” In other words, 124 is not equal to 54.
  2. If the output is “false,” the values of column A and column B for a given row are equal. This means that the “not equal to” condition for that particular row is not met. For instance, the “not equal to” condition for row 5 is “=B5<>A5.” In other words, 120 is certainly equal to 120.

Overall, for three rows (rows 5, 6, and 10), the marks of students A and B are equal. Except for these rows, the marks are unequal in all the remaining rows (rows 3, 4, 7, 8, 9, 11, and 12). Without knowing the magnitude of difference, one cannot conclude whose performance (from students A and B) is better.

Example #2–Compare two Textual Values with the “Not Equal To” Operator

In the dataset of example #1, we have substituted random grades (from A to J) in place of numbers. We want to find the rows for which the grades of students A and B are unequal. Use the “not equal to” operator of Excel.

The steps to find if a difference exists (between the grades) are listed as follows:

Step 1: Enter the formula “=B3<>A3” in cell C3. Press the “Enter” key. The output in cell C3 is “true.” So, for row 3, the “not equal to” excel operator has validated that the values in the first and second cell (A3 and B3) are not equal.

Step 2: Drag the formula of cell C3 till cell C12. The outputs for the entire column C are shown in the following image. The single false output has been colored yellow.

The output in cell C3 meets the “not equal to” excel condition, which is “=B3<>A3.” In contrast, the output in cell C11 does not meet the “not equal to” condition, which is “=B11<>A11.” Hence, the grades of all rows, except row 11, are unequal. The grades of the two students are equal for row 11.

Example #3–Obtain Defined Results with the IF Function and the “Not Equal To” Condition

The succeeding image shows the names of a few candidates and their native places in columns A and B respectively. From these candidates, an organization wants to hire those candidates whose city of origin is “A.”

We want to differentiate candidates who need to be contacted and who need not be contacted for the further hiring process. For this, display the status as either “please call” or “don’t call” (in column C), depending on whether the hometown of a candidate is “A” or not.

Use the IF function and the “not equal to” operator of Excel.

The steps to use the IF functionIF function in Excel evaluates whether a given condition is met and returns a value depending on whether the result is “true” or “false”. It is a conditional function of Excel, which returns the result based on the fulfillment or non-fulfillment of the given criteria.
read more
and the “not equal to” operator are listed as follows:

Step 1: Enter the following formula in cell C2.

“=IF(B2<>”A”,”Don’t call”,”Please Call”)”

Press the “Enter” key. Drag the formula till cell C9. The outputs of column C are shown in the succeeding image. The candidates whose city of origin is “A” have been assigned the “please call” status in column C.

Note: In the given IF formula, the condition [B2<>“A”] is the logical test. The string “don’t call” is “value_if_true” and the string “please call” is “value_if_false.”

So, the IF formula returns “don’t” call” for a given row, if the value of column B is not equal to “A” (i.e., the condition is true). It returns “please call” for a given row, if the value of column B is equal to “A” (i.e., the condition is false).

With the help of the IF function, Excel can display different results for the matched and unmatched conditions. For more details related to the IF function of Excel, click the hyperlink given immediately before step 1 of this example.

Not Equal to Excel Method 2-1

Step 2: The candidates whose hometown is other than “A” have been assigned the “don’t call” status in column C. This is shown in the following image.

Hence, only candidates “Aditya,” “Kuryu,” and “Hrty” should be called for the further round of interviews. The remaining candidates need not be contacted.

So, with the IF function and the “not equal to” excel operator, we have successfully differentiated the candidates who can be hired from those who cannot be hired.

Note: Notice that this step has been added only for the purpose of understanding. The preceding step (step 1) is complete in itself for the given task of hiring candidates.

Example #4–Count Specific Cells with the COUNTIF Function and the “Not Equal To” Condition

The succeeding image shows certain fruits (or items) in column A and their quantities ordered in column B. Apart from apples, mangoes, and cherries, the remaining fruits have been clubbed under “other items” in column A.

We want to count the number of cells (of column A) that are not equal to:

  • “Apples”
  • “Mango”
  • “Cherry”

There should be three outputs, one output excluding one fruit. Use the COUNTIF function and the “not equal to” operator of Excel.

The steps to use the COUNTIF functionThe COUNTIF function in Excel counts the number of cells within a range based on pre-defined criteria. It is used to count cells that include dates, numbers, or text. For example, COUNTIF(A1:A10,”Trump”) will count the number of cells within the range A1:A10 that contain the text “Trump”
read more
and the “not equal to” operator are listed as follows:

Step 1: Enter the following formulas in cells E2, E3, and E4 respectively.

  • “=COUNTIF($A$2:$A$17,”<>Apples”)”
  • “=COUNTIF($A$2:$A$17,”<>Mango”)”
  • “=COUNTIF($A$2:$A$17,”<>Cherry”)”

Press the “Enter” key after entering each formula.

The first formula counts the number of cells in the range A2:A17, which do not contain the string “apples.” Likewise, the second formula counts the number of cells in this range that do not contain the string “mango.” The third formula helps count the number of cells in the given range (A2:A7), which do not contain the string “cherry.” 

Notice that the succeeding image shows the formula in cell E2 and the result of the third formula in cell E4.

Note: “$A$2:$A$17” is the “range” argument of the preceding COUNTIF formulas. The condition “<>Apples” is the “criteria” argument of the first formula. In all the preceding formulas, the range is the same, but the criterions are different.

The COUNTIF counts the cells of a range, which satisfy a single criterion. For more details related to the COUNTIF function, click the hyperlink given before step 1 of this example.

Not Equal to Excel Method 3

Step 2: The following image shows the three outputs (in cells E2, E3, and E4) of the three formulas entered in the preceding step.

Notice that “cherry” has been deliberately misspelled as “cheery” in cell A15. As a result, this cell has also been counted (as a cell not containing “cherry”) by the third COUNTIF formula.

Had the word been correctly spelled in cell A15, the output in cell E4 would have been 12. In this case, cell A15 would have been excluded from the count (as a cell containing “cherry”).

Not Equal to Excel Method 3-1

Step 3: The rows containing “apples” are displayed in black boxes in the following image. These rows are excluded while counting the cells not containing “apples.” Hence, 11 cells (in the range A2:A17) do not contain the string “apples.”

Likewise, in the given range, 12 cells do not contain the string “mango” and 13 cells do not contain the string “cherry.”

Note: This step has been added only for notifying the readers, the cells that are counted and the cells that are left out by the first COUNTIF formula (entered in step 1).

Not Equal to Excel Method 3-2

Example #5–Sum Particular Cells with the SUMIF Function and the “Not Equal To” Condition

Working on the data of example #3, we want to sum the quantities of column B that are not equal to:

  • “Apples”
  • “Mango”
  • “Cherry”

There should be three summed outputs where each output excludes one fruit. Use the SUMIF function and the “not equal to” sign of Excel.

The steps to use the SUMIF functionThe SUMIF Excel function calculates the sum of a range of cells based on given criteria. The criteria can include dates, numbers, and text. For example, the formula “=SUMIF(B1:B5, “<=12”)” adds the values in the cell range B1:B5, which are less than or equal to 12.
read more
and the “not equal to” operator are listed as follows:

Step 1: Enter the following formulas in cells E2, E3, and E4 respectively.

  • “=SUMIF($A$2:$A$17,”<>Apples”,B2:B17)”
  • “=SUMIF($A$2:$A$17,”<>Mango”,B2:B17)”
  • “=SUMIF($A$2:$A$17,”<>Cherry”,B2:B17)”

The first formula is shown in the following image.

In all three formulas, the SUMIF function evaluates the range A2:A17. For cells not equal to “apples” (in range A2:A17), the first formula sums the numbers of the range B2:B17. Likewise, for cells not equal to “mango” in the given range (A2:A17), the second formula also sums the numbers of the range B2:B17. Similar summing is carried out by excluding cells containing “cherry.”

Note: “$A$2:$A$17” is the “range” argument of the SUMIF function. The condition “<>Apples” is the “criteria” argument. The range “B2:B17” is the “sum_range” argument of the SUMIF function.

With the SUMIF function, we have applied the given condition (in each formula) to the range A2:A17 and summed up the corresponding values of the range B2:B17. Usually, the SUMIF works with a single criterion. For more details related to the SUMIF function, click the hyperlink given before step 1 of this example.

Not Equal to Excel Method 4

Step 2: Press the “Enter” key after entering each of the preceding formulas. The three summed outputs are shown in the following image.

Hence, the sum of all the fruit quantities except “apples” is 136. Excluding the cells containing “mango,” this sum is 149. Likewise, leaving the cells containing “cherry,” this sum is 162.

Notice that the value of cell B15 has also been included in the sum returned (in cell E4) by the third SUMIF formula (entered in step 1). This is because in cell A15, the spelling of “cherry” has been misspelled as “cheery.” Hence, Excel considers A15 as a cell not containing “cherry.”

Not Equal to Excel Method 4-1

The important points governing the usage of the “not equal to” operator of Excel are listed as follows:

  • The “not equal to” is the converse of the “equal to” operator. This implies that the interpretation of “true” and “false” is exactly the opposite with these two logical operators.
  • The results produced by the “not equal to” operator are similar to those returned by the NOT function of Excel. The NOT function reverses the “true” and “false” outcomes of a condition. For instance, if the output of a condition is “false,” the formula “=NOT(false)” returns “true.”
  • The “not equal to” operator is case-insensitive. This means that it ignores the casing of the two text strings that are compared. For instance, if “rose” and “ROSE” are compared using the “not equal to” operator, the output is “false.” This is because these two values mean the same to the “not equal to” excel operator.

Frequently Asked Questions

1. Define the “not equal to” operator and state how is it used in Excel.

The “not equal to” excel operator checks whether two values (numeric or textual) being compared are different from each other or not. If the values are different, the output is “true.” If the values are the same, the output is “false.” The “not equal to” operator is the easiest method to ensure that a difference exists between two values.

In Excel, the “not equal to” operator is used as follows:

“=value1<>value2”

“Value1” is the first value to be compared and “value2” is the second value to be compared.

Note: Exclude the beginning and ending double quotation marks while entering the “not equal to” condition in Excel. For more details related to the usage of this operator, refer to the examples of this article.

2. How to use the “not equal to” operator with the conditional formatting feature of Excel?

The steps to use the “not equal to” with the conditional formatting feature of Excel are listed as follows:

a. Select the range on which a conditional formatting rule is to be applied.
b. From the Home tab, click the “conditional formatting” drop-down from the “styles” group. Next, click “new rule.”
c. The “new formatting rule” window opens. Under “select a rule type,” choose the option “use a formula to determine which cells to format.”
d. Under “format values where this formula is true,” enter the desired formula. For instance, if cells (in the range A1:A6) not equal to 2 are to be formatted, enter the formula as “=A1<>2” (without the beginning and ending double quotation marks).
e. Click “format” and select a color from the “fill” tab. Click “Ok” in the “format cells” window.
f. Click “Ok” again in the “new formatting rule” window.

The chosen color (selected in step “e”) is applied to the selected range (selected in step “a”). If the formula given in step “d” is applied, the cells of the range A1:A6, which do not contain 2, are colored. No formatting is applied to the remaining cells.

Note: To conditionally format a range of text values by using the “not equal to” operator, keep the string of the formula in double quotation marks. For instance, the formula [=A1<>“rose”] formats those cells of the selected range which do not contain the string “rose.” Exclude the beginning and ending square brackets while applying this formula.

3. How to use the “not equal to” operator to find blanks in a range of Excel?

The steps to find blanks in Excel by using the “not equal to” operator are listed as follows:

a. Enter the formula containing the cell reference (to be evaluated), “not equal to” operator, and an empty text string. For instance, if blanks in the range A1:A6 are to be found, enter the formula =A1<>“” in cell B1.
b. Press the “Enter” key. Drag the formula to the remaining range (of column B) to obtain outputs for the entire column (column A).

The cells containing blanks have been identified. The formula entered in step “a” returns “true” for all values which are not blanks. For all blank values, this formula returns “false.”

Since the double quotation marks of the formula represent an empty string, a “false” implies that the cell value is equal to an empty string. Conversely, a “true” implies that the cell contains some value, which is not equal to an empty string.

Recommended Articles

This has been a guide to the “not equal to” operator/sign of Excel. Here we discuss how to use the “not equal to” formula in Excel along with step-by-step examples and a downloadable Excel template. You may learn more about Excel from the following articles–

  • VBA IF NOT In VBA, IF NOT is a comparison function that compiles statements and provides inverted outcomes. The function returns “FALSE” if the logical test is correct, and “TRUE” if the logical test is incorrect.read more
  • NOT Excel FunctionNOT Excel function is a logical function in Excel that is also known as a negation function and it negates the value returned by a function or the value returned by another logical function.read more
  • VBA OR FunctionOr is a logical function in programming languages, and we have an OR function in VBA. The result given by this function is either true or false. It is used for two or many conditions together and provides true result when either of the conditions is returned true.read more
  • How to use OR in Excel?

In Excel, <> means not equal to. The <> operator in Excel checks if two values are not equal to each other. Let’s take a look at a few examples.

1. The formula in cell C1 below returns TRUE because the text value in cell A1 is not equal to the text value in cell B1.

Not Equal To Operator

2. The formula in cell C1 below returns FALSE because the value in cell A1 is equal to the value in cell B1.

False

3. The IF function below calculates the progress between a start and end value if the end value is not equal to an empty string (two double quotes with nothing in between), else it displays an empty string (see row 5).

If Not Equal To Empty String

Note: visit our page about the IF function for more information about this Excel function.

4. The COUNTIF function below counts the number of cells in the range A1:A5 that are not equal to «red».

Count Cells Not Equal To Red

Note: visit our page about the COUNTIF function for more information about this Excel function.

5. The COUNTIF function below produces the exact same result. The & operator joins the ‘not equal to’ operator and the text value in cell C1.

Concatenate 'Not Equal To' Operator and Cell Value

6. The COUNTIFS function below counts the number of cells in the range A1:A5 that are not equal to «red» and not equal to «blue».

Count Cells Not Equal To Red and Blue

Explanation: the COUNTIFS function in Excel counts cells based on two or more criteria. This COUNTIFS function has 2 range/criteria pairs.

7. The AVERAGEIF function below calculates the average of the values in the range A1:A5 that are not equal to 0.

Average Cells Not Equal To Zero

Note: in other words, the AVERAGEIF function above calculates the average excluding zeros.

You can use the NOT function in Excel to change FALSE to TRUE or TRUE to FALSE. To illustrate this function, consider the following example.

8. The OR function below returns TRUE if the value in cell A2 equals «USA» or «UK».

OR function

Note: to quickly copy this formula to the other cells, double-click the fill handle (see orange arrow).

9. The formula below returns TRUE if the value in cell A2 is not equal to «USA» or «UK».

NOT function

Explanation: by adding the NOT function, the logical value returned by the OR function is reversed, so that a TRUE value becomes FALSE, and vice versa.

We can use the “Not equal to” comparison operator in Excel to check if two values are not equal to each other. In Excel, the symbol for not equal to is <>. When we check two values with the not equal to formula, our results will be Boolean values which are either True or False. In this tutorial, we will explore the ways to use the Not Equal to Boolean operator in Excel.

Figure 1 – Not equal sign in Excel

Using the “Not Equal to” to test numeric values and text values

We will prepare a data table and then test values from our data table using the <> symbol.

Figure 2 – Data for showing the excel not equal formula

  • In Cell D4, we will enter the formula below and press OK
    =C4<>B4
  • Our result will be displayed as either TRUE or FALSE.

Figure 3 – Not equal to in excel

  • If we drag down the formula into other cells in Column C, we will have:

Figure 4 – Does not equal in excel

Using a “Not Equal To” in Excel IF Formula

We can write IF Statements with the not equal to operator to show specific results when particular conditions are met or not.

  • Again, we will prepare a data table

Figure 5 – Does not equal in excel 

  • In Cell C4, we will insert the formula and press the enter key
    =IF(A4<>B4,"Product Not Matching", "Product Matching")

Figure 6 – How to do not equal in excel

  • We will copy down the formula into other cells. 

Figure 7 – Not equal to symbol in excel

Using the Not Equal to in Excel COUNTIF formula

We can use the not equal to operator to count the number of cells that contain values not equal to a particular value. In this section, we will use the COUNTIF function and the not equal to operators to count other items in our list except the specified item. 

  • We will prepare a data table

Figure 8 – Boolean operators in excel

  • To count all items except Cereal. In Cell E4, we will enter the formula below and press the enter key.
    =COUNTIF(A4:A20,"<>Cereal")

Figure 9 – comparison operators in excel

  • To Count all other items except Soda, we will click on Cell E5, and enter the formula below. 
    =COUNTIF(A4:A20,"<>Soda")

Figure 10 – Does not equal in excel

  1. To Count all items except Snacks, we will click on Cell E6, and enter the formula below
    =COUNTIF(A4:A20,"<>Snacks")

Figure 11 – Boolean operator in excel

Instant Connection to an Excel Expert

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

“Not equal to” is one of the logical operators available in Excel, which allow you to compare cells and analyze large amounts of data. The operator is formed with two angled brackets pointing away from each other: <>. Keep reading to learn how to get the most out of “not equal to” in Excel.

Contents

  1. What is “not equal to” used for in Excel?
  2. “Not equal to” in Excel – a syntax lesson
  3. Using the Excel “not equal to” operator in complex functions
    1. Example 1: “Not equal to” + IF
    2. Example 2: “Not equal to” + IF + AND
    3. Example 3: „Not equal to“ + „SUMIF“ function

What is “not equal to” used for in Excel?

In its simplest application, the “not equal to” operator determines whether or not the values in two cells are equal. The resulting output will either be TRUE or FALSE. However, the “does not equal” operator is rarely used on its own. The operator mainly becomes interesting when combined with functions like IF and OR to dictate what should happen when certain conditions aren’t met.

“Not equal to” in Excel – a syntax lesson

The simplest use of the “not equal to” sign is in a function made up of two conditions and the “not equal to” operator:

=(Condition1<>Condition2)

To illustrate this, let’s use cell A1 with the value “2” for Condition1 and cell B1 with the value “3” for Condition2. We can then use the “not equal to” operator to ask whether A1 is not equal to B1. The result is “TRUE”.

Example in Excel - “does not equal” sign
Comparing the values of two cells with the “not equal to” operator <>

You can also use “does not equal” with more than two cells, columns or values. Simply add another “does not equal” sign and another condition:

=(Condition1<>Condition2<>Condition3)

If you want to implement a “not equal to” comparison for several cells or columns, just click on the fill handle (the green square) and pull it down to the rows you want to compare.

Extending the “not equal to” function to other cells
Extending the “not equal to” function to other cells

Press Enter to implement the function with absolute reference.

Result of comparison with “not equal to” function
The cells will be filled with the “not equal to” function

Using the Excel “not equal to” operator in complex functions

Now that we’ve been over the basic use of the “does not equal” operator, let’s take a look at how to effectively embed it in other functions. The values that the Excel “not equal to” operator returns can help in building IF, OR, or NOT functions.

Example 1: “Not equal to” + IF

The “not equal to” sign is particularly useful when combined with the IF function. The IF function asks whether certain conditions are fulfilled and in case that they are, initiates a certain result. When implemented with IF, the “not equal to” sign is very similar to the “equals” sign.

First, let’s take a look at how the “equals” operator is used with IF. Combined with the IF function, it could be used to check who the winner of a raffle is by comparing the winning number to the number each person drew.

According to this function, if the raffle ticket number in cell B3 is equal to the winning number “104”, then the output value will be “Win”. If it is not equal to “104”, the output value will be “Lose”. You can then use the green fill handle to apply the function to as many cells as you need.

IF function with EQUALS and self-defined output values
The IF function combined with the EQUALS function

With the “does not equal” operator, the function will be almost exactly the same. Simply replace the EQUALS sign with the “does not equal” sign, and change the positions of “Win” and “Lose”:

=IF(B3<>104, "Lose","Win")

This function says that if the raffle ticket number in cell B3 is not equal to the winning number “104”, then the output value will be “Lose”. If it is equal to “104”, the output value will be “Win”.

IF function with “not equal to” and self-defined output values
The IF function combined with “not equal to”

As you can see, you can get similar results with the EQUALS and “not equal to” signs. Thus you can choose whichever operator is better suited to your purposes.

Example 2: “Not equal to” + IF + AND

Once you start combining logical functions and operators, the possibilities are near endless. For example, add the AND function into the mix to make the conditions of the IF function more precise.

Let’s take a look at the syntax for this using the raffle example again.

=IF(AND(A1<>1,B1<>0,C1<>4),"LOSE","WIN")

In this case, all three of the listed numbers have to be a match in order to win. If all three of the numbers are not equal to the winning numbers, then the output is “Lose”. Otherwise it’s “Win”.

Excel: “Not equal to” sign used with IF and AND
“Not equal to” used with IF and AND

Tip

The OR operator works similarly to AND. Try IF and OR combination for another way to make your functions more precise.

Example 3: „Not equal to“ + „SUMIF“ function

The “not equal to” sign is also useful in combination with the mathematical excel function SUMIF. SUMIF returns the sum of all the numbers that fulfill a certain condition. In the following example, SUMIF is used to add the values from cells whose adjacent cells are not empty (whose value is not equal to empty “”).

=SUMIF(C3:C6,"<>"&"",B3:B6)

The function here will look at the values in cells C3-C6 with regard to the criterion “not equal to empty”. The function then adds the values from the cells B3-B6 for the rows that fulfill this criterion (below, rows 3 and 5). The “not equal to” sign must be put in quotations here, and then needs the & sign to combine it with the sign for empty “”.

Excel: “Not equal to” and SUMIF
“Not equal to” used in the SUMIF function

And thus we end up with the sum of the cells in column B whose neighboring cells aren’t empty.

In Excel, the ‘not equal to’ operator checks if two values are not equal to each other. It can also be combined with conditional functions to automate data calculations.

How to Use 'Not Equal To' in Excel

‘Not equal to’ operator (<>) is one of the six logical operators available in Microsoft Excel, which helps check if one value is not equal to another. It is also known as a Boolean operator because the resulting output of any calculation with this operator can only be either TRUE or FALSE.

The <> is a comparison operator that compares two values. If the values are NOT equal, it will return TRUE, else it will return FALSE. The Not Equal operator is often used along with other conditional functions such as IF, OR, SUMIF, COUNTIF functions to create formulas. Now let’s see how we can use ‘Not Equal to’ in Excel.

How to Use the ‘Not Equal to’ <> Comparison Operator in Excel

The syntax of ‘Not Equal’ is:

=[value_1]<>[value_2]
  • value_1 – the first value to be compared.
  • value_2 – the second compared value.

Let’s see how the <> operator works in Excel with some formulas and examples.

Example formula:

=A5<>B5

As you can see below, the formula in cell C5 returns TRUE because the value in cell A5 is not equal to the value in cell B5.

Here, the formula in cell C6 returns FALSE because the value in cell A6 is equal to the value in cell B6.

Let’s see how the ‘Not Equal to’ operator works with text values. It works the same way as it does with the number value.

Remember ‘Not Equal to’ operator in Excel is ‘case-insensitive’, which means even if the values are in different text cases, case differences will be ignored as shown below.


Using ‘<>’ Operator with Functions

Now that we’ve learned how the ‘not equal’ operator works, let’s see how to effectively combine it in other functions.

Using ‘Not Equal To’ with IF Function in Excel

The <> operator is very useful on its own, but it becomes more useful when combined with an IF function. The IF function checks whether certain conditions are met and in case that they are, it returns a certain result, else it returns another result.

The syntax for the IF function is:

=IF(logical_test,[value_if_true],[value_if_false])

Let’s assume we have an inventory list, which lists products and their quantities. If a product’s stock goes below 100, we need to restock it.

Use the below formula:

=IF(C2<>100,"Restock","Full stock")

The formula above checks if the quantity of a product (C2) is not equal to 100, if it’s any less than hundred, then it returns ‘Restock’ in cell D2; if quantity is equal to 100, then it returns ‘Full stock’.

Now, drag the fill handle to apply the formula to other cells.

Using ‘Not Equal To’ with COUNTIF Function in Excel

Excel COUNTIF function counts the cells that meet a given condition in a range. If you want to count the number of cells with a value not equal to the specified value, enter COUNTIF with the ‘<>’ operator.

=COUNTIF(range,criteria)

The criteria used in COUNTIF are logical conditions that support logical operators (>,<,<>,=).

Let’s say we have a student’s marks list. And we want to count the number of students who have passed the test. Below is the formula used:

=COUNTIF(C2:C9,"<>FAIL")

The formula counts cells C2 to C9 if the value is NOT ‘FAIL’. The result is displayed in cell C11.

Using ‘Not Equal To’ with SUMIF Function in Excel

The SUMIF function is used to sum all the numbers when adjacent cells match a certain condition in a range. The general structure of SUMIF function is:

=SUMIF(range,criteria,[sum_range])

In the example below, we want to find the total number of fruits ordered that are not mango. We can use the <> operator with SUMIF function to sum all values from the range (B2:B17) whose adjacent cells (A2:A17) are not equal to ‘Mango’. The result is 144 (cell E2).

=SUMIF(A2:A17,"<>Mango",B2:B17)

Well, now you learned how to use Not Equal to ‘<>’ in Excel.

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2016 for Mac Excel 2013 Excel for iPad Excel for iPhone Excel for Android tablets Excel 2010 Excel for Mac 2011 Excel for Android phones More…Less

Operators specify the type of calculation that you want to perform on the elements of a formula. There is a default order in which calculations occur, but you can change this order by using parentheses.

In this article

  • Types of operators

  • The order in which Excel performs operations in formulas

Types of operators

There are four different types of calculation operators: arithmetic, comparison, text concatenation (combining text), and reference.

Arithmetic operators

To perform basic mathematical operations such as addition, subtraction, or multiplication; combine numbers; and produce numeric results, use the following arithmetic operators in a formula:

Arithmetic operator

Meaning

Example

Result

+ (plus sign)

Addition

=3+3

6

– (minus sign)

Subtraction
Negation

=3–1
=–1

2

-1

* (asterisk)

Multiplication

=3*3

9

/ (forward slash)

Division

=15/3

5

% (percent sign)

Percent

=20%*20

4

^ (caret)

Exponentiation

=3^2

9

Comparison operators

You can compare two values with the following operators. When two values are compared by using these operators, the result is a logical value either TRUE or FALSE.

Comparison operator

Meaning

Example

= (equal sign)

Equal to

A1=B1

> (greater than sign)

Greater than

A1>B1

< (less than sign)

Less than

A1<B1

>= (greater than or equal to sign)

Greater than or equal to

A1>=B1

<= (less than or equal to sign)

Less than or equal to

A1<=B1

<> (not equal to sign)

Not equal to

A1<>B1

Text concatenation operator

Use the ampersand (&) to concatenate (combine) one or more text strings to produce a single piece of text.

Text operator

Meaning

Example

Result

& (ampersand)

Connects, or concatenates, two values to produce one continuous text value

=»North»&»wind»

Northwind

=»Hello» & » » & «world»

This example inserts a space character between the two words. The space character is specified by enclosing a space in opening and closing quotation marks (» «).

Hello world

Reference operators

Combine ranges of cells for calculations with the following operators.

Reference operator

Meaning

Example

: (colon)

Range operator, which produces one reference to all the cells between two references, including the two references

B5:B15

, (comma)

Union operator, which combines multiple references into one reference

SUM(B5:B15,D5:D15)

(space)

Intersection operator, which returns a reference to the cells common to the ranges in the formula. In this example, cell C7 is found in both ranges, so it is the intersection.

B7:D7 C6:C8

Top of Page

The order in which Excel performs operations in formulas

In some cases, the order in which calculation is performed can affect the return value of the formula, so it’s important to understand how the order is determined and how you can change the order to obtain desired results.

Calculation order

Formulas calculate values in a specific order. A formula in Excel always begins with an equal sign (=). The equal sign tells Excel that the characters that follow constitute a formula. Following the equal sign are the elements to be calculated (the operands, such as numbers or cell references), which are separated by calculation operators (such as +, -, *, or /). Excel calculates the formula from left to right, according to a specific order for each operator in the formula.

Operator precedence

If you combine several operators in a single formula, Excel performs the operations in the order shown in the following table. If a formula contains operators with the same precedence — for example, if a formula contains both a multiplication and division operator — Excel evaluates the operators from left to right.

Operator

Description

: (colon)

(single space)

, (comma)

Reference operators

Negation (as in –1)

%

Percent

^

Exponentiation (raising to a power)

* and /

Multiplication and division

+ and –

Addition and subtraction

&

Connects two strings of text (concatenation)

=
< >
<=
>=
<>

Comparison

Use of parentheses

To change the order of evaluation, enclose in parentheses the part of the formula to be calculated first. For example, the following formula produces 11 because Excel calculates multiplication before addition. The formula multiplies 2 by 3 and then adds 5 to the result.

=5+2*3

In contrast, if you use parentheses to change the syntax, Excel adds 5 and 2 together and then multiplies the result by 3 to produce 21.

=(5+2)*3

In the following example, the parentheses around the first part of the formula force Excel to calculate B4+25 first and then divide the result by the sum of the values in cells D5, E5, and F5.

=(B4+25)/SUM(D5:F5)

Top of Page

Need more help?

If you’re comparing two lists of data in Excel, you might need the help of a formula. Heres how to check if cells are not equal to in Excel.

If you’re comparing two lists of data in Excel, you might need the help of a formula to speed up the process. Let’s learn how to check if cells are not equal to in Excel.

Let’s start with a simple example. Let’s start with two lists of data in two columns.

two lists data not equal to in Excel

The simplest way to compare two cells is to write a quick formula. Type =, then click on your first cell. Then, add another equals sign and click on another cell. You’re telling Excel to test for equality.

The formula you see below is:

=F2=G2

Compare cells Excel

If two cells do match, you’ll get TRUE. Now, pull the formula down to see the rest of the results. Notice in the example below that FALSE shows not equal to in Excel results.

True false pulldown

If two cells are not equal to one another in Excel, you’ll get a result of FALSE. This can help you compare cells and find ones that are not equal to in Excel. This works for comparing both text and numeric values.

How to Use An If Statement For Not Equal To In Excel

Want to show more than “TRUE” and “FALSE” in Excel? It’s time to learn a bit about IF statements, and use not equal to in Excel formulas.

Let’s look at this example for fun. Let’s say that we’re playing a game of rolling dice and want to see which rolls win.

I’ve set the magic number – a dice roll of 5 – in cell I1. I’ve also recorded seven dice rolls, and now I’m ready to write a formula to check to see which won.

Dice roll number test

Let’s write an IF Statement to check for not equal to in Excel. If statements are formulas that follow this format:

=IF(logical_test, [value if true], [value_if_false])

Basically, you’re asking Excel to test if something is true, and then to show values based on if it’s true.

My example formula is:

=IF(E2<>$I$1,"Lose","Win")

Notice that we’re using “<>” to test if two cells are not equal. This formula tells Excel to compare E2 to I1, then show LOSE if the cells aren’t equal.

(Note: the dollar signs in “$I$1” freeze the cell reference so that this works well as we autofill the formula.)

if statement added

Now, let’s just pull down the formula. Notice that only the winning cells show “Win.” Combining tests for equality with an if statement is all you need.

Compared cells Excel

The Excel 365 Filter function accepts the <> operator. So let’s see how to use this not equal to in the Filter function formulas in Excel 365.

Instead of the said operator, we can also use the NOT logical function in Excel 365 Filter. You will find those examples too in this post.

In my last Excel 365 tutorial, I have explained the use of AND, OR in the Filter function in Excel.

If you didn’t see that post, you may follow the above link and read that first.

Why should I read that specific tutorial?

It’s because we will use the AND, OR (the * and + operators) again here with not equal to in Filter.

My sample data to use in the not equal to in the Filter function in Excel 365 contains two columns – 1st Week and 2nd Week.

Each column contains a few names.

Here I am going to use English Alphabets “A”, “B”, and “C” to represent those names.

Single Criterion Use

Let’s filter the table or an array in the table if the value in A2:A6 is not equal to the name “C”.

=FILTER(A2:B6,A2:A6<>"C")

Example to not equal to in Filter function in Excel

Sometimes, you may happen to see the #NAME? error.

In that case, check whether the function is spelled correctly.

If it’s correct, then your version of Excel 365 may not be supporting this function.

If you prefer to use the NOT Excel function instead of the <> operator, then use the below formula.

=FILTER(A2:B6,NOT(A2:A6="C"))

Is there any specific advantage of using the function over the operator here in Filter?

I don’t see any!

Multiple Criteria Use in Not Equal to in Filter Function in Excel 365

I wish to give you all the possible formula variations to the use of the not equal to in the Filter function in Excel 365.

Let’s filter the table if the criterion in A2:A6 is not equal to “B” or “C”.

=FILTER(A2:B6,(A2:A6<>"B")*(A2:A6<>"C"))

Same column, but two criteria

Here again, we can rewrite the above Excel formula with its NOT logical function. If you rewrite, it would be as below.

=FILTER(A2:B6,NOT(A2:A6="B")*NOT(A2:A6="C"))

Not Equal to in Multiple Columns in Filter Function in Excel 365

Either of the Condition Match

How to filter the table if the array A2:A6 or B2:B6 doesn’t contain the name “C”?

In other words exclude the rows if either of the condition matches, i.e. either A2:A6 not equal to “C” or B2:B6 not equal to “C”.

=FILTER(A2:B6,(A2:A6<>"C")*(B2:B6<>"C"))

or;

=FILTER(A2:B6,NOT(A2:A6="C")*NOT(B2:B6="C"))

Not equal to in two columns in Filter function in Excel

Both of the Conditions Match

With some changes in the above formula, we can achieve this.

Let’s just change the * to + so that both the conditions will match.

Quite confusing?

See the formulas and image.

=FILTER(A2:B6,(A2:A6<>"C")+(B2:B6<>"C"))

or;

=FILTER(A2:B6,NOT(A2:A6="C")+NOT(B2:B6="C"))

Conditions to test in two columns, plus sign use

Conclusion

In all my Excel formula examples, I have coded the formula to filter the whole table based on the provided criterion/criteria.

To get only any specific array, change the reference A2:B6 in the Filter ‘array’ with A2:A6 or B2:B6.

SYNTAX:

Filter(array,include,[if_empty])

Refer to the syntax to identify the position of the ‘array’ argument in the formula.

Another point is if the criterion is in a cell, use it as below in the formula.

If you type “A”, without double quotes, in cell C1, the same can be used in the formula as below.

=FILTER(A2:B6,A2:A6<>C1)

I hope you found this Excel 365 tutorial helpful!

Понравилась статья? Поделить с друзьями:
  • Excel for macbook pro
  • Excel for macbook air
  • Excel for mac условное форматирование
  • Excel for mac поиск решения
  • Excel for mac перенос строки