‘Not Equal to’ Operator in Excel (With 5 Examples)

In this tutorial, you will learn about the Not Equal To operator in Excel with examples and illustrations. Here’s an overview of the basic use of the operator.

not equal to in excel


What Is ‘Not Equal to’ in Excel?

The Not Equal To is a logical operator that compares two values. It is opposite to the Equal To. To express this operator, we use the pair of angle brackets (<>) in Excel. It returns a Boolean value TRUE or FALSE.

  • TRUE means the two values are not identical or equal.
  • FALSE means the two values are the same or equivalent.

How to Use the ‘Not Equal to’ Operator in Excel?

The basic syntax of this operator is:

=value1 <> value2

The values can be cell references or constants. Here are some examples.

not equal to in excel


The ‘Not Equal to’ Operator with Other Functions: 5 Examples


Example 1 – ‘Not Equal to’ in the IF Function

We have some student names and their grades. We’ll find the students who failed the exam. If anyone’s grade is not equal to “F”, they passed.

Steps

  • Use the following formula in Cell D5:

=IF(C5<>"F","Passed","Failed")

not equal to in excel

  • Press Enter.
  • Drag the Fill handle icon over the range of cells D6:D9.

not equal to in excel

Read More: How to Use Comparison Operators in Excel


Example 2 – ‘Not Equal To’ with the SUMIF Function

You can see some salesperson names, their selling products, and the sales amount. We’ll find the total sales without the product TV.

Steps

  • Insert the following formula in Cell C12:

=SUMIF(C5:C9,"<>"&C11,D5:D9)

‘Not Equal To’ with Excel SUMIF Function

  • Press Enter.


Example 3 – Excel COUNTIF Function with the ‘Not Equal To’ Operator

We have a dataset of some Fruits. We’ll count the number of total fruits without including “Apple”.

Steps

  • Use the following formula in Cell D5:

=COUNTIF(B5:B13,"<>"&"Apple")

Excel COUNTIF Function with ‘Not Equal To’ Operator

  • Press Enter.

Read More: How to Use Less Than Or Equal to Operator in Excel


Example 4 – Combining ‘Not Equal To’ with the COUNTIFS Function

We have a dataset of some colors. We’ll use the Not Equal To operator to count the number of colors without “Red” and “Blue”.

Steps

  • Use the following formula in Cell D5:

=COUNTIFS(B5:B13,"<>"&"Red",B5:B13,"<>"&"Blue")

  • Press Enter.


Method 5 – AVERAGEIF with ‘Not Equal to’ in Excel

We have some data on salaries. Let’s find the average salary for both male and female employees.

Steps

  • Insert the following formula in Cell D12:

=AVERAGEIF(C5:C10,"<>"&"Female",D5:D10)

  • Press Enter.

AVERAGEIF with ‘Not Equal To’ in Excel

  • Use the following formula in Cell D13:

=AVERAGEIF(C5:C10,"<>"&"Male",D5:D10)

AVERAGEIF with ‘Not Equal To’ in Excel

  • Press Enter.


Things to Remember

The Not Equal To operator requires at least two values to check. It won’t work until you give two values.

The Not Equal To operator is case-insensitive. For instance, if you compare “ball” and “BALL” in, it will return FALSE.


Download the Practice Workbook


Further Readings


<< Go Back to Excel Operators | Excel Formulas | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
A.N.M. Mohaimen Shanto
A.N.M. Mohaimen Shanto

A.N.M. Mohaimen Shanto, a B.Sc. in Computer Science and Engineering from Daffodil International University, boasts two years of experience as a Project Manager at Exceldemy. He authored 90+ articles and led teams as a Team Leader, meticulously reviewing over a thousand articles. Currently, he focuses on enhancing article quality. His passion lies in Excel VBA, Data Science, and SEO, where he enjoys simplifying complex ideas to facilitate learning and growth. His journey mirrors Exceldemy's dedication to excellence and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo