ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Logic
  3. Excel Comparison Operators: =, <>, >, <, >=, <=

Excel Comparison Operators: =, <>, >, <, >=, <=

By ExcelReady Team·Updated October 30, 2026·6 min read

The short answer

In Excel, "not equal to" is written <>, so =A2<>"Delivered" returns TRUE when A2 is anything other than Delivered. Excel has six comparison operators: = equal, <> not equal, > greater than, < less than, >= greater than or equal, and <= less than or equal. Each returns TRUE or FALSE.

Key takeaways

  • Excel writes not equal to as <>; != and ≠ don't work in formulas.
  • In two-character operators the < or > comes first: >= and <=, never => or =<.
  • Text comparisons ignore capital letters but not spaces; use EXACT for a case-sensitive check.
  • Compare dates with DATE(2025,1,1) or a date cell, not a date typed inside quotes.
  • In COUNTIF and SUMIF, the operator goes in quotes: "<>Delivered" or ">"&M1.
On this page+
  1. What are the six comparison operators in Excel?
  2. Excel not equal to: how to use <>
  3. How do comparisons work with text?
  4. How do you compare dates in Excel?
  5. How do you use comparison operators in COUNTIF and SUMIF?
  6. How do blank cells compare?
  7. Can you add up TRUE and FALSE?
  8. How to use comparisons inside IF and other functions
  9. Practise it

Excel not equal to is written <>: a less-than sign followed by a greater-than sign. It is one of six comparison operators, the signs that ask Excel a yes-or-no question and get TRUE or FALSE back. Every IF, COUNTIF and conditional format depends on them, so this guide covers all six, plus the edge cases with text, dates and blank cells.

What are the six comparison operators in Excel?#

A comparison operator compares two values and returns TRUE or FALSE. These are logical values, not text, so other formulas can use them. Here they are, tested on an order of exactly 100 in D3:

OperatorMeaningExampleResult
=Equal to=D3=100TRUE
<>Not equal to=D3<>100FALSE
>Greater than=D3>100FALSE
<Less than=D3<100FALSE
>=Greater than or equal to ("at least")=D3>=100TRUE
<=Less than or equal to ("at most")=D3<=100TRUE

The first = starts the formula. The second one is the comparison. In the two-character signs, the < or > always comes first: >= and <=. Excel rejects => and =<.

Excel does comparisons last, after any maths in the formula. So =D3+20>100 adds first and then compares: (100+20) is greater than 100, so the result is TRUE. You don't need brackets around the sum, but adding them can make the formula easier to read.

The boundary is where most mistakes happen. "Over 100" means >100, which leaves out 100 itself. "At least 100" means >=100, which includes it.

Excel not equal to: how to use <>#

<> returns TRUE when two values are different. It works with numbers, text and cell references:

Excel formula
=C2<>"Delivered"
=E2<>D2

The first is TRUE for any status other than Delivered, such as Pending or Cancelled. The second is TRUE when the amount paid doesn't match the order amount.

Excel doesn't accept != (used in many programming languages) or the ≠ symbol. Only <> works.

To turn the answer into a label, put it inside IF:

Excel formula
=IF(C2<>"Delivered","Follow up","Done")

To check that a cell isn't empty, compare it with empty text: =B2<>"" is TRUE when B2 holds anything.

How do comparisons work with text?#

Text goes in double quotes, and three rules apply:

  1. Capital letters are ignored. ="LEEDS"="Leeds" is TRUE. For a case-sensitive check, use =EXACT(B2,"Leeds").
  2. Spaces count. "Leeds " with a trailing space is not equal to "Leeds". Clean imported data with TRIM: =TRIM(B2)="Leeds".
  3. Greater and less than compare alphabetically. ="apple"<"banana" is TRUE because a comes before b.

Without quotes, =B2=Leeds gives #NAME?, because Excel looks for something called Leeds.

There's one surprise when numbers meet text. Excel treats any text as greater than any number. So if a score of 58 in B2 was imported as text, =B2>=70 returns TRUE, and a failing score can show as a pass. Check those cells with ISNUMBER and ISTEXT.

How do you compare dates in Excel?#

Excel stores dates as numbers, so the operators work on them directly. Build the date with DATE, or point at a cell that holds one:

Excel formula
=A2>=DATE(2025,1,1)
=A2<=$J$3

Don't type the date in quotes, like =A2>="1/1/2025". That compares a number with text, and text always counts as greater, so the answer is always FALSE. DATE also avoids locale problems: 1/2/2025 means January 2 in the US but February 1 in the UK and much of Europe.

How do you use comparison operators in COUNTIF and SUMIF?#

Inside COUNTIF, SUMIF and their -IFS versions, the operator goes inside quotes as part of the criteria:

Excel formula
=COUNTIF(C2:C7,"<>Delivered")
=COUNTIF(D2:D7,">"&M1)
=SUMIF(D2:D7,">=100")
  • The first counts orders whose status isn't Delivered. It also counts empty cells in the range, so make sure the range stops at the last row of data.
  • The second compares with a cell. Keep the cell outside the quotes and join it with &. Inside quotes, ">M1" is just the letters M and 1.
  • The third adds every amount of at least 100.

See how COUNTIF counts with conditions for more criteria examples.

How do blank cells compare?#

An empty cell counts as 0 in a number comparison and as empty text in a text comparison. So if B2 is empty, both =B2=0 and =B2="" return TRUE. That can make a missing value look like a real zero. If blanks matter, test for them first with =ISBLANK(B2) or =B2="".

Can you add up TRUE and FALSE?#

Yes, with care. In a calculation, Excel treats TRUE as 1 and FALSE as 0. So =(D2>100)*1 gives 1 or 0, and =(D2>100)*D2 gives the amount only when it's over 100.

But SUM skips TRUE and FALSE values stored in cells. If F2:F7 holds the results of =D2>100, =SUM(F2:F7) returns 0. Count them with COUNTIF instead:

Excel formula
=COUNTIF(F2:F7,TRUE)

Or skip the helper column and count straight from the data with =SUMPRODUCT(--(D2:D7>100)). The double minus turns each TRUE or FALSE into 1 or 0 so SUMPRODUCT can add them. On six orders of 120, 100, 85.5, 240, 64 and 150 in D2:D7, both give 3: the amounts 120, 240 and 150. The order of exactly 100 doesn't count, because 100 is not greater than 100.

How to use comparisons inside IF and other functions#

A comparison on its own shows TRUE or FALSE. Most of the time you use it as the test of another function:

GoalFormula
Show a label=IF(D2>$M$1,"Needs approval","OK")
Several conditions=AND(D2>=100,C2<>"Cancelled")
Count matches=COUNTIF(B2:B7,"<>York")
Turn exact codes into labels=SWITCH(C2,"P","Pending","D","Delivered","Other")

For the IF pattern, read the Excel IF function explained simply. When you're matching a cell against several exact values, the SWITCH function is often shorter than a chain of = tests. The IF function guide has a quick reference for every argument.

Practise it#

Comparison signs are quick to learn but easy to get wrong under time pressure. Try the exercise on this page, then practise TRUE, FALSE and comparisons in a live spreadsheet. You'll use all six operators on real orders, including text, boundary values and a locked approval limit.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

In F4, return TRUE if order 1003's status in C4 is not equal to Delivered. Use the not-equal operator, and put the text in double quotes.

fx
ABCDEFG
1
Order
City
Status
Amount
Paid
2
1001
Leeds
Delivered
120
120
3
1002
York
Delivered
100
60
4
1003
Leeds
Pending
85.5
85.5
5
1004
Hull
Pending
240
0
6
1005
LEEDS
Delivered
64
70
7
8
9

Tip: Not equal to is < followed by >. The text Delivered needs straight double quotes.

Practise this in a lesson

LessonTRUE, FALSE and comparisonsAsk Excel yes-or-no questions with =, <>, >, <, >= and <=, and get TRUE or FALSE back. The building block of every IF.Function guideIFLearn Excel's IF function with practical examples: flag budgets, label rows and return blanks. Avoid the classic mistakes and practice live.

Frequently asked questions

How do you write not equal to in Excel?

+

Use the less-than and greater-than signs together: <>. For example, =B2<>"York" is TRUE for every city except York, and =IF(B2<>"York","Other","York") turns it into a label.

Why doesn't != work in Excel?

+

!= is the not-equal sign in many programming languages, but Excel formulas only recognise <>. Typing != makes Excel reject the formula.

How do I count cells that are not equal to a value?

+

Use COUNTIF with the operator in quotes: =COUNTIF(C2:C7,"<>Delivered"). Note that it also counts empty cells in the range.

Are Excel comparisons case-sensitive?

+

No. ="LEEDS"="Leeds" returns TRUE. For a case-sensitive check, use EXACT: =EXACT(B2,"Leeds").

How do I check if a cell is not blank?

+

Use =B2<>"". It returns TRUE when B2 holds anything, including a number or text, and FALSE when it is empty.

Sources

  • Calculation operators and precedence in Excel - Microsoft Support
  • IF function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What are the six comparison operators in Excel?
  2. Excel not equal to: how to use <>
  3. How do comparisons work with text?
  4. How do you compare dates in Excel?
  5. How do you use comparison operators in COUNTIF and SUMIF?
  6. How do blank cells compare?
  7. Can you add up TRUE and FALSE?
  8. How to use comparisons inside IF and other functions
  9. Practise it

Keep reading

Logic· 7 min read

The SWITCH Function in Excel (Turn Codes Into Labels)

The Excel SWITCH function compares one value with a list of options and returns the result paired with the first exact match: =SWITCH(D2,"P","Pending","S","Shipped","Other"). The last single value is the default, shown when nothing matches. Without a default, SWITCH returns #N/A. SWITCH needs Excel 2019 or later.

Logic· 6 min read

ISBLANK, ISNUMBER and ISTEXT in Excel

ISBLANK returns TRUE when a cell is completely empty, ISNUMBER returns TRUE when it holds a real number, and ISTEXT returns TRUE when it holds text. Each takes one cell, like =ISBLANK(C2). They are most useful inside IF, for example =IF(ISNUMBER(C2),"OK","Check"), to catch bad data before you calculate with it.

Logic· 6 min read

The Excel IF Function Explained Simply

The Excel IF function checks a condition and returns one value when it's TRUE and another when it's FALSE. The syntax is =IF(logical_test, value_if_true, value_if_false). For example, =IF(B2>=70,"Pass","Fail") shows Pass for a score of 70 or more and Fail for anything lower. Text results go in double quotes.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free