Does Not Equal in Excel: How to Use the <> Operator 2026
Learn how to use the does not equal operator (<>) in Excel for IF, COUNTIF, SUMIF, and filters. Step-by-step formulas, real cases, common pitfalls.

How the Does Not Equal Operator Works in Excel
The does not equal operator in Excel is written as two angle brackets stuck together: <>. Yes, that little symbol is the entire trick. You drop it between two values, and Excel returns TRUE when those values are different โ FALSE when they match. Simple in theory. Sometimes annoying in practice, especially when blank cells, hidden spaces, or stray apostrophes throw the result off. Practice with the free Excel practice test on PracticeTestGeeks (500+ questions with answer explanations).
Most people meet <> first inside an IF statement. Something like =IF(A2<>"Approved","Check",""). But the operator does much more. You can pair it with COUNTIF, SUMIF, SUMIFS, AVERAGEIFS, and even array formulas. It even shows up inside data validation rules and conditional formatting logic โ anywhere Excel needs a yes/no comparison.
And here is where the confusion starts. <> behaves slightly differently with numbers, text, errors, and empty cells. A number compared with text? Different. A blank cell compared with an empty string ""? Excel often says they are equal โ sometimes not. That is why this guide walks you through every realistic scenario so you stop guessing.
Microsoft Excel: upcoming dates and official changes
- Jun 30, 2026: Certiport retired the Microsoft Office Specialist 2016 certifications, including MOS Excel 2016, on June 30, 2026. The Microsoft 365 Apps and Office 2019 Excel exams are still available. (certiport.pearsonvue.com)
- Updated Oct 16, 2026: Delivery is now Proctored live-in-the-application exam via Certiport Authorized Testing Centers (in-center or remote-proctored) (previously Proctored live-in-the-application exam via Certiport Authorized Testing Centers).
- Updated Oct 16, 2026: Eligibility is now No formal prerequisites; about 150 hours of instruction and hands-on experience recommended (previously No formal prerequisites; ~150 hours of instruction and hands-on experience recommended (Associate)).
- Updated Oct 16, 2026: Time limit is now 50 minutes (60 minutes seat time) (previously 50 minutes (60 minutes seat time)).
Facts verified Oct 17, 2026 against Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business. Dates that have passed are removed automatically.
- The MOS Excel (Microsoft 365 Apps) exam has 33 to 37 questions. (certiport.pearsonvue.com)
- The MOS Excel Expert (Microsoft 365 Apps) exam has 23 to 27 questions. (certiport.pearsonvue.com)
- Microsoft Office Specialist Excel exams last 50 minutes, with 60 minutes of total seat time. (Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business)
- The passing score for Microsoft Office Specialist Excel exams is always 700 on Certiport's 1 to 1000 scaled score. (certiport.pearsonvue.com)
- After failing a Microsoft Office Specialist Excel exam, candidates must wait 24 hours before the first retake and 48 hours before each later retake, and there is no annual limit on attempts. (Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business)
- Microsoft Office Specialist Excel certifications earned on or after September 23, 2025 are valid for five years; those earned earlier do not expire. (certiport.pearsonvue.com)
- The Microsoft Office Specialist Excel exam is proctored and delivered live in the Excel application through Certiport Authorized Testing Centers, either in person or remote-proctored. (Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business)
- Microsoft recommends that candidates for the MOS Excel Associate (Microsoft 365 Apps) certification have about 150 hours of instruction and hands-on experience with Excel. (Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business)
- Candidates get their MOS Excel score report as soon as they finish the exam, and it can also be viewed in their Certiport profile. (certiport.pearsonvue.com)
Facts verified Oct 17, 2026 against Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business. Dates that have passed are removed automatically.
Microsoft Excel Exam at a Glance
| Item | Detail | Official source |
|---|---|---|
| Number of questions (Excel Associate (MO-210)) | 33-37 questions | certiport.pearsonvue.com |
| Number of questions (Excel Expert (MO-211)) | 23-27 questions | certiport.pearsonvue.com |
| Time limit | 50 minutes (60 minutes seat time) | Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business |
| Passing score | 700 on a 1โ1000 scale | certiport.pearsonvue.com |
| Retake policy | Wait 24h after 1st fail, 48h before each later retake; no annual limit | Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business |
| Validity | Valid 5 years (earned on/after Sept 23, 2025) | certiport.pearsonvue.com |
| Delivery | Proctored live-in-the-application exam via Certiport Authorized Testing Centers (in-center or remote-proctored) | Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business |
| Eligibility | No formal prerequisites; about 150 hours of instruction and hands-on experience recommended | Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business |
| Score release | Score report at end of exam; also in Certiport profile | certiport.pearsonvue.com |
Facts verified Oct 17, 2026 against Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business. Dates that have passed are removed automatically.
Free Excel Study Tools
Interactive Excel resources on PracticeTestGeeks, free to start:
- Free Excel Questions and Answers โ 16 questions with instant scoring and answer explanations
- Excel flashcards โ review key terms and concepts card by card
- Excel study guide โ topic-by-topic overview of what the exam covers
- Excel cheat sheet โ one-page printable summary for last-minute review
Quick Facts About the <> Operator

Basic Syntax and Where to Place the Operator
The cleanest way to use the does not equal sign in Excel is as a standalone comparison: =A1<>B1. Type that in any empty cell. If A1 and B1 hold different values, the cell returns TRUE. If they match, FALSE. That is it. No quotes, no equal sign before the angle brackets, no spaces between them.
Things get more interesting when you wrap the operator inside other functions. The pattern stays the same โ left value, <>, right value โ but you also need quotes around literal text. Numbers go bare. Cell references stay bare. Text strings need quotes. That single rule trips up beginners more than anything else.
Here are the four most common contexts where the operator appears, and they cover roughly 95% of real-world spreadsheets you will ever build or audit.
The One Rule You Must Remember
Always wrap text values in double quotes when using <> inside a function. Numbers and cell references stay unquoted. So =COUNTIF(A:A,"<>Pending") is correct, but =COUNTIF(A:A,<>Pending) returns an error. This single rule fixes most beginner mistakes with the operator.
Using <> Inside an IF Function
This is the workhorse pattern. You want Excel to do one thing when two values differ, and something else when they match. Maybe flag rows where the budget does not equal the actual spend. Or highlight invoices where the billing address is different from the shipping address. The IF formula handles it.
Type this in any cell: =IF(B2<>C2,"Mismatch","OK"). When B2 and C2 are different, Excel writes "Mismatch". When they are identical, "OK". You can extend this to nested IFs, IFS, or SWITCH โ but the comparison logic stays the same.
One thing worth flagging early: Excel treats text comparisons as case-insensitive by default. So ="Apple"<>"apple" returns FALSE โ Excel says they are equal. If you need case-sensitive logic, swap in the EXACT function and wrap it: =IF(NOT(EXACT(A2,B2)),"Different","Same"). That is a small detail that catches even experienced users off guard.
Where the <> Operator Shines
Run conditional logic when two values differ. The classic pattern for flagging mismatches, exceptions, or unequal entries in any audit workflow.
Count rows where a column does not equal a specific value. Great for excluding categories like "Pending" or "Cancelled" from totals.
Add up numbers while excluding rows that match a condition. Common in financial reports where you want everything except a particular department or status.
Prevent users from typing certain values into a cell. Use a custom formula like =A1<>"Banned" to block specific entries.
Counting Cells That Do Not Equal a Value
COUNTIF with <> is one of the most useful combinations in everyday Excel work. Say you have a column of order statuses โ Approved, Pending, Cancelled, Refunded โ and you want to count everything that is not Cancelled. The formula is straightforward: =COUNTIF(A2:A100,"<>Cancelled").
Notice the structure. The criteria is a single string. The operator and the value both go inside the same set of double quotes. No spaces. No concatenation needed if the value is a literal. Excel parses it correctly because COUNTIF expects exactly this format for criteria arguments.
But what if you want to count cells that do not equal a value stored in another cell? You need to concatenate. The pattern becomes =COUNTIF(A2:A100,"<>"&D1). The ampersand glues the operator to the value pulled from D1. Forget the ampersand and Excel either errors out or returns a wrong count, because it thinks you are looking for literal text "<>D1".
The same logic applies to COUNTIFS for multi-criteria counts. Each criteria pair handles its own operator. So you might write =COUNTIFS(A:A,"<>Cancelled",B:B,">100") to count rows where status is not Cancelled and amount exceeds 100. Powerful, readable, and reliable once you get the quoting right.
Operator Syntax by Function Type

Summing Cells That Do Not Equal a Value
SUMIF is COUNTIF's cousin, and it follows nearly the same rules. The big difference is you need three arguments: the range to check, the criteria, and the range to add up. Want to total all sales that are not from the "Returns" category? Try =SUMIF(A2:A1000,"<>Returns",B2:B1000).
SUMIFS handles multiple conditions. The argument order flips โ sum range first, then pairs of criteria range and criteria. So =SUMIFS(C:C,A:A,"<>Returns",B:B,">=2024-01-01") sums column C where column A is not Returns and column B is on or after January 1, 2024. Order matters here. Mix it up and Excel either errors or returns nonsense.
People often ask why SUMIF gives zero when they think it should not. Nine times out of ten, the criteria range and the sum range are different sizes, or the data has trailing spaces. Excel sees "Returns " (with a space) as different from "Returns" โ which is technically correct behavior, but it produces unexpected results. TRIM the data first, or use wildcards if you need fuzzy matching.
Excel treats a truly blank cell and a cell containing "" (an empty string from a formula) differently. =A1<>"" returns FALSE if A1 is empty but TRUE if A1 contains "". This trips up COUNTIF and SUMIF criteria all the time. Use ISBLANK() when you need to distinguish them, or LEN(A1)=0 for a length-based check that catches both cases.
The Operator Inside Array Formulas and Boolean Math
You can multiply TRUE/FALSE results by 1 to get binary counts, and that opens up array tricks that COUNTIF cannot handle. The formula =SUMPRODUCT((A2:A100<>"")*(B2:B100<>"Cancelled")) counts rows where column A is not empty and column B is not "Cancelled". This is faster than nested IF arrays in older Excel versions, and it works in every version since Excel 2007.
Modern Excel โ anything from Microsoft 365 or Excel 2021 โ also supports dynamic arrays. So you can write =ROWS(FILTER(A2:A100,B2:B100<>"Cancelled")) to count rows where B is not Cancelled, with cleaner syntax. The FILTER function pulls back every row meeting the condition, and ROWS counts what came back.
For boolean-driven calculations, remember that <> returns TRUE or FALSE, and Excel treats TRUE as 1 and FALSE as 0 in math operations. So =SUM((A2:A100<>100)*1) entered as an array formula (Ctrl+Shift+Enter in older versions) counts how many cells do not equal 100. Useful when you want to embed the logic inside a larger formula.
Common Pitfalls to Avoid
- โForgetting to wrap text literals in double quotes when using <> inside COUNTIF or SUMIF
- โMissing the ampersand when concatenating <> with a cell reference
- โAssuming text comparisons are case-sensitive โ they are not unless you use EXACT()
- โTreating blank cells and empty strings as the same thing
- โUsing = instead of <> by accident, especially when copying formulas from other sheets
- โLetting trailing spaces in data sneak through and break comparisons
- โMixing up criteria range and sum range order in SUMIFS
- โComparing a number stored as text against a real number โ they will be flagged as different
Conditional Formatting with the <> Operator
One of the cleanest uses for the does not equal operator is highlighting differences between two columns. Suppose you have an expected column in A and an actual column in B. Select A2:B100, open Conditional Formatting, choose "New Rule", pick "Use a formula", and enter =$A2<>$B2. Apply a fill color, click OK. Now every row where A and B differ jumps off the page.
The dollar signs lock the columns but let the row numbers shift, so the rule walks down the range checking each row independently. If you forgot the dollar signs, the rule would only check row 2 across the entire range โ clearly not what you want.
You can also highlight cells that do not equal a specific value. Select the range, create a formula rule, and use =A2<>"Approved". Every cell where the value is not "Approved" gets the format. This is faster than filtering manually, and the formatting updates automatically when the data changes.
When to Use the <> Operator
- +Works in every version of Excel, including Excel for the web and mobile
- +Compatible with all major functions: IF, COUNTIF, SUMIF, AVERAGEIFS, FILTER
- +No need for helper columns when used inside conditional formatting
- +Faster than nested IF chains for simple yes/no comparisons
- +Reads naturally in formulas, making audits easier for other users
- โCase-insensitive by default โ needs EXACT() for case-sensitive checks
- โTrips up beginners with quoting rules in COUNTIF and SUMIF
- โBlank versus empty string ambiguity causes silent errors
- โCannot natively handle wildcards inside the criteria string
- โSlightly slower than SWITCH or hard-coded equality in massive datasets
Pros and Cons at a Glance
| Pros | Cons |
|---|---|
| Works in every version of Excel, including Excel for the web and mobile | Case-insensitive by default โ needs EXACT() for case-sensitive checks |
| Compatible with all major functions: IF, COUNTIF, SUMIF, AVERAGEIFS, FILTER | Trips up beginners with quoting rules in COUNTIF and SUMIF |
| No need for helper columns when used inside conditional formatting | Blank versus empty string ambiguity causes silent errors |
| Faster than nested IF chains for simple yes/no comparisons | Cannot natively handle wildcards inside the criteria string |
| Reads naturally in formulas, making audits easier for other users | Slightly slower than SWITCH or hard-coded equality in massive datasets |

Comparing Dates, Numbers, and Errors with <>
Date comparisons work the same way as numbers because Excel stores dates as serial numbers under the hood. So =A2<>DATE(2025,1,1) returns TRUE if A2 is any date other than January 1, 2025. The date function builds a proper serial number, which Excel compares cleanly. Avoid typing dates as text strings inside the formula โ that introduces locale issues and false negatives.
Numbers stored as text are a common gotcha. If column A has 100 as a number and column B has "100" as text (because of a CSV import or a leading apostrophe), =A2<>B2 returns TRUE โ Excel says they are different. Fix this by running VALUE() on the text column, or use Text to Columns to convert in bulk.
For error values like #N/A or #DIV/0!, the operator propagates the error. So =A2<>B2 returns #N/A if either cell holds an error. Wrap with IFERROR if you need to handle this gracefully: =IFERROR(A2<>B2,"Check inputs"). That way the formula returns your fallback message instead of an error code.
Sample Excel Practice Questions
Try these questions from our free Excel practice tests. The correct answer and an explanation follow each question.
What does the CONCATENATE function (or & operator) do in Excel?
- A. Splits text into multiple cells
- B. Joins multiple text strings into one
- C. Counts characters in a cell
- D. Formats text as a number
Answer: B. Joins multiple text strings into one
CONCATENATE joins two or more text strings into a single string; the & operator achieves the same result.
What does the CONCATENATE function (or the & operator) do in Excel?
- A. Joins two or more text strings into one
- B. Counts the number of characters in a string
- C. Searches for one text string within another
- D. Converts numbers to text format
Answer: A. Joins two or more text strings into one
CONCATENATE (or the & operator) combines multiple text values into a single string, for example =A1&" "&B1.
What does the & operator do in an Excel formula?
- A. Performs logical AND
- B. Concatenates text strings
- C. Adds two numbers
- D. Compares two values
Answer: B. Concatenates text strings
The & operator joins (concatenates) text values, functioning identically to the CONCATENATE function.
What does the 'What-If Analysis' group in Excel's Data tab include?
- A. Only Goal Seek
- B. Scenario Manager, Goal Seek, and Data Table
- C. Solver and Data Table only
- D. Forecast Sheet and Scenario Manager only
Answer: B. Scenario Manager, Goal Seek, and Data Table
The What-If Analysis group contains Scenario Manager, Goal Seek, and Data Table.
Take the full Excel practice test
Excel Questions and Answers
Real-World Examples That Use the Does Not Equal Operator
Let me walk you through a few realistic scenarios where you would actually reach for <> in everyday work. These are the kinds of things that pop up in financial reports, HR spreadsheets, inventory tracking, and customer data audits. Once you see the pattern, you will start spotting opportunities all over your own workbooks.
Scenario One: Counting Active Customers
Imagine you have a customer table with a Status column. Statuses include Active, Inactive, Pending, and Churned. You want a quick count of everyone who is not Churned. The formula is =COUNTIF(D2:D5000,"<>Churned"). That single cell now updates automatically every time the Status column changes. Drop it into a dashboard, and you have a live count of every customer who has not officially left.
If you also want to exclude Inactive customers from the same count, switch to COUNTIFS or wrap a SUMPRODUCT around two conditions. The COUNTIFS version reads =COUNTIFS(D2:D5000,"<>Churned",D2:D5000,"<>Inactive"). Both conditions must be TRUE for the row to count. That gives you the population of currently engaged customers โ Active plus Pending โ without the noise.
Scenario Two: Summing Sales Excluding Refunds
Sales reports almost always have a Returns or Refund category that you want to subtract out โ or simply exclude โ to see clean revenue. Suppose column A has the transaction type and column B has the dollar amount. The formula =SUMIF(A2:A2000,"<>Refund",B2:B2000) adds up every row where the type is not Refund. Quick. Clean. No helper column needed.
If you want to layer in a date filter โ say, only transactions from the current quarter โ SUMIFS takes over. The pattern becomes =SUMIFS(B:B,A:A,"<>Refund",C:C,">="&DATE(2025,1,1),C:C,"<"&DATE(2025,4,1)). Notice how each criteria pair handles its own operator and its own column. SUMIFS is verbose but reliable.
Scenario Three: Flagging Mismatched Records
You imported a CSV and now you want to compare it against your master list. Both files share a key column โ say, customer email โ and a verification column. If the verification status differs between sources, you want a flag. Put the master in columns A and B, the import in columns C and D. In column E, drop =IF(B2<>D2,"Mismatch","OK") and copy down. Now every row that does not agree gets flagged.
You can extend this with conditional formatting to color the mismatched rows. Select A2:E5000, create a formula rule using =$B2<>$D2, and assign a red fill. The rows light up automatically wherever the two sources disagree. This is the bread and butter of data audits.
Three Quick Recipes Using <>
=COUNTIF(D2:D5000,"<>Churned") โ gives you a live count of every customer who has not officially left.
=SUMIF(A2:A2000,"<>Refund",B2:B2000) โ clean revenue total without subtraction or helper columns.
=IF(B2<>D2,"Mismatch","OK") โ column flag for any row where two source files disagree.
Performance Notes for Big Spreadsheets
The <> operator itself is fast. Excel evaluates it in nanoseconds. The slowdown, when it happens, comes from the function wrapping the operator โ usually COUNTIF or SUMIF running across hundreds of thousands of rows. If your workbook starts feeling sluggish, the fix is rarely to swap out <>. Instead, look at how you are referencing the range.
Using full-column references like A:A forces Excel to scan all 1,048,576 rows whether you have data there or not. That is a lot of empty cells. Switching to explicit ranges like A2:A50000 can cut calculation time dramatically, especially on older machines. Excel's modern smart recalculation helps, but explicit ranges still win for predictable performance.
Another option for massive datasets is to convert your data to a proper Excel Table โ Insert tab, Table button, or Ctrl+T. Table references like Customers[Status] automatically size to the data, so you get the performance of an explicit range with the convenience of a full-column reference. Plus formulas auto-fill when you add new rows, which is worth the conversion all on its own.
For workbooks that crunch millions of rows, consider Power Query or Power Pivot rather than fighting with COUNTIF and SUMIF. Both tools handle <>-style filters far more efficiently and let you build proper data models. But for everything up to a few hundred thousand rows, the classic operator approach is still the right call.
Performance Numbers Worth Knowing
Putting the <> Operator to Work
The does not equal operator is one of those tiny pieces of Excel that punches far above its weight. Two angle brackets. That is the whole symbol. Yet you can use it to build mismatch audits, exclusion totals, conditional formatting that catches bad data, and data validation rules that block forbidden entries. Once you internalize the quoting rules and the blank-versus-empty-string gotcha, the operator becomes second nature.
If you are still getting unexpected results, the fix is almost always one of three things. First, check your quotes โ text needs them, numbers do not. Second, check for trailing spaces or numbers stored as text by running TRIM() and VALUE(). Third, look for blanks pretending to be empty strings โ ISBLANK() and LEN() will tell you which is which. Walk through those three, and 95% of your <> problems vanish.
Beyond the basics, mixing the operator with SUMPRODUCT, FILTER, and dynamic array functions opens up patterns that simply were not possible in older Excel versions. So if you have access to Microsoft 365 or Excel 2021, lean into the array-friendly functions. They make criteria like "not equal to any of these values" much easier to express than legacy COUNTIFS chains.
How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy
Sources & references
Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy
- learn.microsoft.com โ Retake policy, test delivery, time limit, eligibility ยท verified Oct 2026
- certiport.pearsonvue.com โ Exam format, score validity, passing score, score release, exam information ยท verified Oct 2026