How to Create Inequalities in Microsoft Excel
What You Need to Know About Inequalities in Excel
Inequalities in Excel are comparisons. You compare one value against another and get a TRUE or FALSE result. That's it. No magic, no complexity. Just logic.
Most people use inequalities without realizing itβwhen you filter data above a certain value, when you create conditional rules, when you build any kind of decision-making formula. Here's how to actually use them.
The Six Inequality Operators
Excel has six comparison operators. Learn these first, because everything else depends on them.
- > β Greater than
- < β Less than
- >= β Greater than or equal to
- <= β Less than or equal to
- = β Equal to
- <> β Not equal to
These work in formulas, filters, and conditional formatting. They always return TRUE or FALSE.
Basic Inequality Formulas
Type a formula that compares two values. Start with =, then use the operator.
Example: =A1>100
This checks if the value in cell A1 is greater than 100. If it is, you get TRUE. If not, you get FALSE.
You can compare:
- Cell to cell:
=A1>B1 - Cell to number:
=A1>=50 - Text to text:
=A1="Complete" - Mixed:
=A1<>B1(checks if they're different)
Using Inequalities with IF Statements
Inequalities become useful when combined with IF. The syntax is:
=IF(logical_test, value_if_true, value_if_false)
Example: =IF(A1>=1000, "High", "Low")
This checks if A1 is 1000 or more. If yes, it returns "High". If no, it returns "Low".
You can nest multiple conditions:
=IF(A1>=1000, "High", IF(A1>=500, "Medium", "Low"))
Three tiers. Clean. No need to overcomplicate it.
Counting and Summing with Inequalities
COUNTIF and SUMIF let you count or total cells based on conditions.
COUNTIF Examples
=COUNTIF(A:A, ">100")β counts cells greater than 100=COUNTIF(A:A, "<50")β counts cells less than 50=COUNTIF(A:A, ">=500")β counts cells 500 or more=COUNTIF(A:A, "<>0")β counts cells that aren't zero
SUMIF Examples
=SUMIF(A:A, ">100", B:B)β sums values in column B where column A is greater than 100=SUMIF(A:A, "<0", B:B)β sums where column A is negative
COUNTIFS and SUMIFS for Multiple Conditions
Add more criteria with COUNTIFS or SUMIFS:
=COUNTIFS(A:A, ">100", A:A, "<500")
Counts cells between 100 and 500.
Conditional Formatting with Inequalities
Highlight cells based on their values. This is where inequalities save you time.
- Select your range of cells
- Go to Home β Conditional Formatting β New Rule
- Choose Format cells that contain
- Set your condition (e.g., "Cell Value > 100")
- Pick your formatting
- Click OK
You can also use formulas in conditional formatting for more control:
=$A1>100
This applies the format to any row where column A exceeds 100.
Filtering Data with Inequalities
Excel's filter function uses inequalities behind the scenes, but you can set custom criteria:
- Select your data range
- Go to Data β Advanced (not just Filter)
- Use criteria range with your inequality conditions
This is useful for extracting records that meet specific thresholds.
Quick Reference Table
| Operator | Formula Example | Returns TRUE when |
|---|---|---|
| > | =A1>100 | A1 is greater than 100 |
| < | =A1<50 | A1 is less than 50 |
| >= | =A1>=100 | A1 is 100 or more |
| <= | =A1<=50 | A1 is 50 or less |
| = | =A1=100 | A1 equals exactly 100 |
| <> | =A1<>100 | A1 is not 100 |
Common Mistakes to Avoid
- Text in quotes, numbers not β
>100not>"100" - Forgetting the equals sign β formulas start with =
- Using <> instead of != β Excel uses <> for "not equal"
- Mismatched data types β comparing text to numbers gives FALSE, not an error
Getting Started
Try this exercise:
- Open a blank spreadsheet
- Put numbers in cells A1 through A10
- In cell B1, type:
=IF(A1>50, "High", "Low") - Copy B1 down to B10
You now have a simple classifier. Change the numbers in column A and column B updates automatically.
That's the foundation. From here, you can build COUNTIF formulas, conditional formatting rules, or complex nested IF statements. The operators don't changeβonly how you combine them.