In this article we will show how to use the IF function with the not equal operator to create an if not equal formula. Example formulas and images included.
IF Not Equal to Google Sheets
1. Determine the Values to Compare
For our example we will compare the values in Column B to the values in Column A. We want to see when the two values are the same and display the result in Column C.
2. Select an Empty Cell
Here we will be selecting Cell C2 to compare the values in A2 and B2.
3. Use the IF Not Equal formula =IF(condition, value_if_true, value_if_false)
In Google Sheets, you can use the "IF" function to create an "IF NOT EQUAL" formula. The original syntax of the IF Formula is
=IF(condition, value_if_true, value_if_false)
Condition: Logical operation that Google Sheets will use to determine if true or false. We will be using the Not Equal To logical operator by putting the angle bracket symbols “<>” in between the values we want to compare.
Value_if_true: Cell display when condition is satisfied. We want to display Not Equal when the values are the same.
Value_if_false: Cell display when condition is not satisfied. We want to display Equal when values are not the same.
Following this our Modified IF NOT EQUAL formula becomes
We will copy the formula to cell C3 up to cell C16 and see that when the values are not equal, Column C displays Not Equal.
You can easily modify the formula to suit your specific needs. For example, you could use a cell reference, specific text or a formula instead of a static value in the “condition”, "value_if_true" and "value_if_false" arguments to create more complex logical operations.
To be able to use text values, simply encode your values/words around quotation marks (“”). (eg. A1<>”Complete”)
For static cell references, where you want to compare all your values to only one cell reference, you can use the dollar sign “$” to make sure your values don’t move around. (eg. A1<>$B$1)