How to Use IF Statement with Not Equal To Operator in Excel

To illustrate using the IF function with the not equal to operator, let’s examine a representative dataset. First Collection and Second Collection are columns that contain some data of various types. We will determine whether the information in one column matches the appropriate cell in the other column.

excel if statement not equal


Example 1 – Insert the Not Equal To (<>) Operator in IF Function in Excel

To check if something is not equal to another, use the Not Equal To (<>) sign in Excel.

Steps:

  • Create another column titled Compare Collection throughout D.

Insert Not Equal To (<>) Operator in Excel If Statement

  • Select the cell D5.
  • Insert the following expression in the Formula bar.

=IF(B5<>C5,"Unmatched","Matched")

  • Hit the Enter or Tab keys.
  • You will get the intended outcome like in the image.

Insert Not Equal To (<>) Operator in Excel If Statement

  • Hold the AutoFill Handle icon from cell D5 and drag it to cell D10. This will copy the formula to the other cells.

Insert Not Equal To (<>) Operator in Excel If Statement

Read More: Excel IF Statement Between Two Numbers


Example 2 – Utilize the NOT Function with a Not Equal to Statement in Excel

The NOT function is a unary logical function. It returns the opposite of a given Boolean value or the logical test result.

Steps:

  • Make a new column D and give it the heading Compare Collection.

Utilize Excel NOT Function to Apply Not Equal in If Statement

  • Choose the D5 cell.
  • Input the following statement into the Formula bar:

=IF(NOT(B5=C5),"Unmatched","Matched")

  • Hit the Enter or Tab key.

  • Press and hold the AutoFill Handle, then drag it to the D10.
  • This will copy the formula throughout the cells.

Utilize Excel NOT Function to Apply Not Equal in If Statement

Read More: How to Check If Cell Contains One of Several Values in Excel


Download the Practice Workbook


Related Articles

Get FREE Advanced Excel Exercises with Solutions!
Lutfor Rahman Shimanto
Lutfor Rahman Shimanto

Lutfor Rahman Shimanto, BSc, Information Technology, Jahangirnagar University, Bangladesh, has worked with the ExcelDemy project for over a year. He has written 50+ articles and provided solutions of 100+ comments for ExcelDemy. Currently, he works as an Excel & VBA Developer and provides support and solutions in the ExcelDemy Forum. He has solved 100+ ExcelDemy Forum problems. His work and learning interests are in developing various Excel & VBA and Desktop applications. Outside of work, he enjoys Chess... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo