Excel compare not in

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

Watch Video – Compare two Columns in Excel for matches and differences

The one query that I get a lot is – ‘how to compare two columns in Excel?’.

This can be done in many different ways, and the method to use will depend on the data structure and what the user wants from it.

For example, you may want to compare two columns and find or highlight all the matching data points (that are in both the columns), or only the differences (where a data point is in one column and not in the other), etc.

Since I get asked about this so much, I decided to write this massive tutorial with an intent to cover most (if not all) possible scenarios.

If you find this useful, do pass it on to other Excel users.

Note that the techniques to compare columns shown in this tutorial are not the only ones.

Based on your dataset, you may need to change or adjust the method. However, the basic principles would remain the same.

If you think there is something that can be added to this tutorial, let me know in the comments section

Compare Two Columns For Exact Row Match

This one is the simplest form of comparison. In this case, you need to do a row by row comparison and identify which rows have the same data and which ones does not.

Example: Compare Cells in the Same Row

Below is a data set where I need to check whether the name in column A is the same in column B or not.

Compare Columns - row by row - dataset

If there is a match, I need the result as “TRUE”, and if doesn’t match, then I need the result as “FALSE”.

The below formula would do this:

=A2=B2

Compare Lists in Excel - matches are shown as TRUE

Example: Compare Cells in the Same Row (using IF formula)

If you want to get a more descriptive result, you can use a simple IF formula to return “Match” when the names are the same and “Mismatch” when the names are different.

=IF(A2=B2,"Match","Mismatch")

If formula to compare columns in Excel

Note: In case you want to make the comparison case sensitive, use the following IF formula:

=IF(EXACT(A2,B2),"Match","Mismatch")

With the above formula, ‘IBM’ and ‘ibm’ would be considered two different names and the above formula would return ‘Mismatch’.

Example: Highlight Rows with Matching Data

If you want to highlight the rows that have matching data (instead of getting the result in a separate column), you can do that by using Conditional Formatting.

Here are the steps to do this:

  1. Select the entire dataset.
  2. Click the ‘Home’ tab.Click the Home Tab in the Excel ribbon
  3. In the Styles group, click on the ‘Conditional Formatting’ option.Click on Conditional Formatting
  4. From the drop-down, click on ‘New Rule’.Click on the New Rule option
  5. In the ‘New Formatting Rule’ dialog box, click on the ‘Use a formula to determine which cells to format’.Click on Use Formula option
  6. In the formula field, enter the formula: =$A1=$B1Formula to compare columns in Conditional Formatting
  7. Click the Format button and specify the format you want to apply to the matching cells.Set Formatting in conditional formatting
  8. Click OK.

This will highlight all the cells where the names are the same in each row.

Compare two columns and highlight matching rows

Compare Two Columns and Highlight Matches

If you want to compare two columns and highlight matching data, you can use the duplicate functionality in conditional formatting.

Note that this is different than what we have seen when comparing each row. In this case, we will not be doing a row by row comparison.

Example: Compare Two Columns and Highlight Matching Data

Often, you’ll get datasets where there are matches, but these may not be in the same row.

Something as shown below:

Compare two columns and highlight macthes - dataset

Note that the list in column A is bigger than the one in B. Also some names are there in both the lists, but not in the same row (such as IBM, Adobe, Walmart).

If you want to highlight all the matching company names, you can do that using conditional formatting.

Here are the steps to do this:

  1. Select the entire data set.
  2. Click the Home tab.
  3. In the Styles group, click on the ‘Conditional Formatting’ option.Click on Conditional Formatting
  4. Hover the cursor on the Highlight Cell Rules option.
  5. Click on Duplicate Values.Select Duplicate Values in Conditional Formatting
  6. In the Duplicate Values dialog box, make sure ‘Duplicate’ is selected.Duplicate in Conditional Formatting
  7. Specify the formatting.Specify the formatting in conditional formatting
  8. Click OK.

The above steps would give you the result as shown below.

Highlighted matching data when comparing lists in Excel

Note: Conditional Formatting duplicate rule is not case sensitive. So ‘Apple’ and ‘apple’ are considered the same and would be highlighted as duplicates.

Example: Compare Two Columns and Highlight Mismatched Data

In case you want to highlight the names which are present in one list and not the other, you can use the conditional formatting for this too.

  1. Select the entire data set.
  2. Click the Home tab.
  3. In the Styles group, click on the ‘Conditional Formatting’ option.Click on Conditional Formatting
  4. Hover the cursor on the Highlight Cell Rules option.
  5. Click on Duplicate Values.Select Duplicate Values in Conditional Formatting
  6. In the Duplicate Values dialog box, make sure ‘Unique’ is selected.Select Unique to highlight differences
  7. Specify the formatting.Specify the formatting to highlight differences in two columns
  8. Click OK.

This will give you the result as shown below. It highlights all the cells that have a name that is not present on the other list.

Compare Two columns and highlight differences

Compare Two Columns and Find Missing Data Points

If you want to identify whether a data point from one list is present in the other list, you need to use the lookup formulas.

Suppose you have a dataset as shown below and you want to identify companies that are present in column A but not in Column B,

Compare two columns and highlight macthes - dataset

To do this, I can use the following VLOOKUP formula.

=ISERROR(VLOOKUP(A2,$B$2:$B$10,1,0))

This formula uses the VLOOKUP function to check whether a company name in A is present in column B or not. If it is present, it will return that name from column B, else it will return a #N/A error.

These names which return the #N/A error are the ones that are missing in Column B.

ISERROR function would return TRUE if there is the VLOOKUP result is an error and FALSE if it isn’t an error.

compare lists and find missing data

If you want to get a list of all the names where there is no match, you can filter the result column to get all cells with TRUE.

You can also use the MATCH function to do the same;

=NOT(ISNUMBER(MATCH(A2,$B$2:$B$10,0)))

Note: Personally, I prefer using the Match function (or the combination of INDEX/MATCH) instead of VLOOKUP. I find it more flexible and powerful. You can read the difference between Vlookup and Index/Match here.

Compare Two Columns and Pull the Matching Data

If you have two datasets and you want to compare items in one list to the other and fetch the matching data point, you need to use the lookup formulas.

Example: Pull the Matching Data (Exact)

For example, in the below list, I want to fetch the market valuation value for column 2. To do this, I need to look up that value in column 1 and then fetch the corresponding market valuation value.

Compare two lists in Excel and fetch matching data

Below is the formula that will do this:

=VLOOKUP(D2,$A$2:$B$14,2,0)

or

=INDEX($A$2:$B$14,MATCH(D2,$A$2:$A$14,0),2)

Lookup and Pull matching data - market valuation Excel

Example: Pull the Matching Data (Partial)

In case you get a dataset where there is a minor difference in the names in the two columns, using the above-shown lookup formulas is not going to work.

These lookup formulas need an exact match to give the right result. There is an approximate match option in VLOOKUP or MATCH function, but that can’t be used here.

Suppose you have the data set as shown below. Note that there are names that are not complete in Column 2 (such as JPMorgan instead of JPMorgan Chase and Exxon instead of ExxonMobil).

Pull matching Data - partial match

In such a case, you can use a partial lookup by using wildcard characters.

The following formula will give is the right result in this case:

=VLOOKUP("*"&D2&"*",$A$2:$B$14,2,0)

or

=INDEX($A$2:$B$14,MATCH("*"&D2&"*",$A$2:$A$14,0),2)

Partial comparison in columns with wildcard characters

In the above example, the asterisk (*) is a wildcard character that can represent any number of characters. When the lookup value is flanked with it on both sides, any value in Column 1 which contains the lookup value in Column 2 would be considered as a match.

For example, *Exxon* would be a match for ExxonMobil (as * can represent any number of characters).

You May Also Like the Following Excel Tips & Tutorials:

  • How to Compare Two Excel Sheets (for differences)
  • How to Highlight Blank Cells in Excel.
  • How to Compare Text in Excel (Easy Formulas)
  • Highlight EVERY Other ROW in Excel.
  • Excel Advanced Filter: A Complete Guide with Examples.
  • Highlight Rows Based on a Cell Value in Excel
  • How to Compare Dates in Excel (Greater/Less Than, Mismatches)

Excel 2013 Office for business Spreadsheet Compare 2013 Spreadsheet Compare 2016 Spreadsheet Compare 2019 Spreadsheet Compare 2021 More…Less

Let’s say you have two Excel workbooks, or maybe two versions of the same workbook, that you want to compare. Or maybe you want to find potential problems, like manually-entered (instead of calculated) totals, or broken formulas. You can use Microsoft Spreadsheet Compare to run a report on the differences and problems it finds.

Important: Spreadsheet Compare is only available with Office Professional Plus 2013, Office Professional Plus 2016, Office Professional Plus 2019, or Microsoft 365 Apps for enterprise.

Open Spreadsheet Compare

On the Start screen, click Spreadsheet Compare. If you do not see a Spreadsheet Compare option, begin typing the words Spreadsheet Compare, and then select its option.

In addition to Spreadsheet Compare, you’ll also find the companion program for Access – Microsoft Database Compare. It also requires Office Professional Plus versions or Microsoft 365 Apps for enterprise.

Compare two Excel workbooks

  1. Click Home > Compare Files.

    The Compare Files dialog box appears.

  2. Click the blue folder icon next to the Compare box to browse to the location of the earlier version of your workbook. In addition to files saved on your computer or on a network, you can enter a web address to a site where your workbooks are saved.

    Compare Files command

  3. Click the green folder icon next to the To box to browse to the location of the workbook that you want to compare to the earlier version, and then click OK.

    Tip: You can compare two files with the same name if they’re saved in different folders.

  4. In the left pane, choose the options you want to see in the results of the workbook comparison by checking or unchecking the options, such as Formulas, Macros, or Cell Format. Or, just Select All.

    Spreadsheet Compare options

  5. Click OK to run the comparison.

If you get an «Unable to open workbook» message, this might mean one of the workbooks is password protected. Click OK and then enter the workbook’s password. Learn more about how passwords and Spreadsheet Compare work together.

The results of the comparison appear in a two-pane grid. The workbook on the left corresponds to the «Compare» (typically older) file you chose and the workbook on the right corresponds to the «To» (typically newer) file. Details appear in a pane below the two grids. Changes are highlighted by color, depending on the kind of change.

Understanding the results

  • In the side-by-side grid, a worksheet for each file is compared to the worksheet in the other file. If there are multiple worksheets, they’re available by clicking the forward and back buttons on the horizontal scroll bar.

    Note: Even if a worksheet is hidden, it’s still compared and shown in the results.

  • Differences are highlighted with a cell fill color or text font color, depending on the type of difference. For example, cells with «entered values» (non-formula cells) are formatted with a green fill color in the side-by-side grid, and with a green font in the pane results list. The lower-left pane is a legend that shows what the colors mean.

Comparison results of two versions of a workbook

In the example shown here, results for Q4 in the earlier version weren’t final. The latest version of the workbook contains the final numbers in the E column for Q4.

In the comparison results, cells E2:E5 in both versions have a green fill that means an entered value has changed. Because those values changed, the calculated results in the YTD column also changed – cells F2:F4 and E6:F6 have a blue-green fill that means the calculated value changed.

The calculated result in cell F5 also changed, but the more important reason is that in the earlier version its formula was incorrect (it summed only B5:D5, omitting the value for Q4). When the workbook was updated, the formula in F5 was corrected so that it’s now =SUM(B5:E5).

  • If the cells are too narrow to show the cell contents, click Resize Cells to Fit.

Resize Cells

Excel’s Inquire add-in

In addition to the comparison features of Spreadsheet Compare, Excel 2013 has an Inquire add-in you can turn on that makes an «Inquire» tab available. From the Inquire tab, you can analyze a workbook, see relationships between cells, worksheets, and other workbooks, and clean excess formatting from a worksheet. If you have two workbooks open in Excel that you want to compare, you can run Spreadsheet Compare by using the Compare Files command.

If you don’t see the Inquire tab in Excel, see Turn on the Inquire add-in. To learn more about the tools in the Inquire add-in, see What you can do with Spreadsheet Inquire.

Next steps

If you have «mission critical» Excel workbooks or Access databases in your organization, consider installing Microsoft’s spreadsheet and database management tools. Microsoft Audit and Control Management Server provides powerful change management features for Excel and Access files, and is complemented by Microsoft Discovery and Risk Assessment Server, which provides inventory and analysis features, all aimed at helping you reduce the risk associated with using tools developed by end users in Excel and Access.

Also see Overview of Spreadsheet Compare.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

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?

I have two columns in Excel, and I want to find (preferably highlight) the items that are in column B but not in column A.

What’s the quickest way to do this?

Excellll's user avatar

Excellll

12.5k11 gold badges50 silver badges78 bronze badges

asked Dec 10, 2009 at 18:44

C. Ross's user avatar

  1. Select the list in column A
  2. Right-Click and select Name a Range…
  3. Enter «ColumnToSearch»
  4. Click cell C1
  5. Enter this formula: =MATCH(B1,ColumnToSearch,0)
  6. Drag the formula down for all items in B

If the formula fails to find a match, it will be marked #N/A, otherwise it will be a number.

If you’d like it to be TRUE for match and FALSE for no match, use this formula instead:

=ISNUMBER(MATCH(B1,ColumnToSearch,0))

If you’d like to return the unfound value and return empty string for found values

=IF(ISNUMBER(MATCH(B1,ColumnToSearch,0)),"",B1)

Chris Marisic's user avatar

answered Dec 10, 2009 at 19:01

devuxer's user avatar

devuxerdevuxer

3,9316 gold badges31 silver badges33 bronze badges

6

Here’s a quick-and-dirty method.

Highlight Column B and open Conditional Formatting.

Pick Use a formula to determine which cells to highlight.

Enter the following formula then set your preferred format.

=countif(A:A,B1)=0

Excellll's user avatar

Excellll

12.5k11 gold badges50 silver badges78 bronze badges

answered May 9, 2011 at 16:18

Ellesa's user avatar

EllesaEllesa

10.8k2 gold badges38 silver badges52 bronze badges

2

Select the two columns. Go to Conditional Formatting and select Highlight Cell Rules. Select Duplicate values. When you get to the next step you can change it to unique values. I just did it and it worked for me.

answered Apr 16, 2015 at 20:02

DOB 's user avatar

DOB DOB

2813 silver badges2 bronze badges

4

Took me forever to figure this out but it’s very simple. Assuming data begins in A2 and B2 (for headers) enter this formula in C2:

=MATCH(B2,$A$2:$A$287,0)

Then click and drag down.

A cell with #N/A means that the value directly next to it in column B does not show up anywhere in the entire column A.

Please note that you need to change $A$287 to match your entire search array in Column A. For instance if your data in column A goes down for 1000 entries it should be $A$1000.

n.st's user avatar

n.st

1,8781 gold badge17 silver badges30 bronze badges

answered Dec 6, 2013 at 20:43

brenton's user avatar

brentonbrenton

1711 silver badge2 bronze badges

1

See my array formula answer to listing A not found in B here:

=IFERROR(INDEX($A$2:$A$1999,MATCH(0,IFERROR(MATCH($A$2:$A$1999,$B$2:$B$399,0),COUNTIF($C$1:$C1,$A$2:$A$1999)),0)),»»)

Comparing two columns of names and returning missing names

C. Ross's user avatar

C. Ross

6,06416 gold badges60 silver badges82 bronze badges

answered Oct 21, 2011 at 14:02

Jeeped's user avatar

1

My requirements was not to highlight but to show all values except that are duplicates amongst 2 columns. I took help of @brenton’s solution and further improved to show the values so that I can use the data directly:

=IF(ISNA(MATCH(B2,$A$2:$A$2642,0)), A2, "")

Copy this in the first cell of the 3rd column and apply the formula through out the column so that it will list all items from column B there are not listed in column A.

answered Feb 24, 2014 at 11:10

Gautam Jain's user avatar

1

Thank you to those who have shared their answers. Because of your solutions, I was able to make my way to my own.

In my version of this question, I had two columns to compare — a full graduating class (Col A) and a subset of that graduating class (Col B). I wanted to be able to highlight in the full graduating class those students who were members of the subset.

I put the following formula into a third column:

=if(A2=LOOKUP(A2,$B$2:$B$91),1100,0)

This coded most of my students, though it yielded some errors in the first few rows of data.

answered Sep 11, 2014 at 13:25

Drew McAllister's user avatar

in C1 write =if(A1=B1 , 0, 1). Then in Conditional formatting, select Data bars or Color scales. It’s the easiest way.

Jawa's user avatar

Jawa

3,60913 gold badges31 silver badges36 bronze badges

answered Feb 16, 2015 at 9:52

A.Ramin walyar's user avatar

Понравилась статья? Поделить с друзьями:
  • Excel comments delete all
  • Excel comma separated values files
  • Excel combobox умная таблица
  • Excel combobox в ячейке выпадающий список
  • Excel combobox with values