sodcalculator

10 Tech How-To

Excel Less Than or Equal To Operator: How to Use

Guide 10-28192 · Updated · Step by step

The less than or equal to operator (<=) in Excel lets you compare two values and return TRUE if the first is smaller than or exactly equal to the second, and FALSE otherwise. It is essential for conditional formatting, filtering, and building logical tests with the IF function. This guide shows you how to use it in formulas, with examples you can copy directly into your own spreadsheets.

What You’ll Need

  • Microsoft Excel (2010 or later; the steps are the same for Excel for Microsoft 365, Excel 2021, 2019, 2016, and 2013).
  • A spreadsheet with at least two columns of numbers or dates you want to compare.
  • Basic familiarity with typing formulas into a cell (starting with an equals sign).

Step-by-Step

  1. Open your Excel worksheet and locate the cell where you want the comparison result to appear. For example, if you have test scores in column A and passing scores in column B, you might put the result in column C.
  2. Type the equals sign (=) to begin any formula. Every formula in Excel starts with =.
  3. Enter the first value or cell reference. You can type a number directly (like 5) or click a cell (like A2). For example, to compare the value in A2 with the value in B2, type =A2.
  4. Type the less than or equal to operator: <=. Make sure there are no spaces between the characters. The full formula so far looks like =A2<=.
  5. Enter the second value or cell reference. Type a number or click another cell, for example B2. Your complete formula is now =A2<=B2.
  6. Press Enter. Excel evaluates the comparison and displays either TRUE (if A2 is less than or equal to B2) or FALSE (if A2 is greater than B2).
  7. Copy the formula down if you have multiple rows. Click the small square at the bottom-right corner of the cell (the fill handle) and drag it down to apply the same comparison to other rows.
  8. Use the operator inside an IF function for more useful output. For example, type =IF(A2<=B2, "Pass", "Fail"). This will show “Pass” when the condition is TRUE and “Fail” when it is FALSE.
  9. Apply it in conditional formatting to highlight cells. Select the range you want to format, go to the Home tab, click Conditional Formatting, choose “New Rule”, select “Use a formula to determine which cells to format”, and enter a formula like =A2<=100. Then set a format and click OK.
  10. Use it with dates. The operator works with dates as well. For example, =A2<=TODAY() returns TRUE if the date in A2 is today or earlier.

Common Mistakes

  • Typing the operator backwards: =< is not valid. Always type the less-than sign first, then the equals sign: <=.
  • Adding spaces: A2 <= B2 will cause a formula error. Remove spaces around the operator.
  • Using a single equals sign: =A2=B2 tests for equality only, not less than or equal to. Use <= for the combined test.
  • Comparing text with numbers: The operator works on numbers and dates, but comparing text strings with <= may give unexpected results because Excel sorts text alphabetically (e.g., “apple” <= “banana” is TRUE).
  • Forgetting the leading equals sign: If you type just A2<=B2 without the initial =, Excel treats it as text, not a formula.

Tips

  • Combine with AND/OR: Use =AND(A2<=100, B2>=50) to test multiple conditions at once.
  • Use absolute references when comparing to a fixed value. For example, =A2<=$D$1 locks the reference to cell D1 so it doesn’t change when you copy the formula down.
  • Format the result: Instead of showing TRUE/FALSE, wrap the comparison in an IF function to display custom text like “Yes”/”No” or “Within limit”/”Over limit”.
  • Use in COUNTIF/SUMIF: The operator is used inside criteria. For example, =COUNTIF(A:A, "<=100") counts all values less than or equal to 100. Note that the operator is enclosed in quotes.
  • Check the result with F9: In the formula bar, select the part of the formula you want to evaluate (e.g., A2<=B2) and press F9 to see the result. Press Esc to undo.

Troubleshooting

  • Formula shows as text: If the cell displays =A2<=B2 instead of TRUE/FALSE, the cell is formatted as Text. Select the cell, go to the Home tab, change the number format to General, then re-enter the formula by pressing F2 and Enter.
  • #NAME? error: This usually means you typed the operator incorrectly or have a typo in a function name. Check that you used <= and not < =.
  • #VALUE! error: This occurs when one of the cells contains text that cannot be compared numerically. Ensure both cells contain numbers or dates, not text like “N/A”.
  • Unexpected FALSE result: If the comparison should be TRUE but returns FALSE, check for hidden decimal places. Use the ROUND function: =ROUND(A2,2)<=ROUND(B2,2).
  • Conditional formatting not highlighting: Make sure the formula is relative to the top-left cell of the selected range. If your range starts at A2, the formula should reference A2, not A1.

Frequently Asked Questions

Can I use the less than or equal to operator with text?

Yes, but it compares text alphabetically. For example, “apple” <= “banana” returns TRUE because “a” comes before “b”. This is rarely useful, so it’s best to use it with numbers or dates.

How do I count cells that are less than or equal to a value?

Use the COUNTIF function with the criteria in quotes: =COUNTIF(A:A, "<=100"). This counts all numbers in column A that are 100 or less.

What is the difference between <= and =< in Excel?

The correct operator is <=. The sequence =< is not recognized by Excel and will cause an error. Always type the less-than sign first.

Can I use <= with dates?

Yes. Dates are stored as numbers in Excel, so you can compare them. For example, =A2<=DATE(2025,1,1) returns TRUE if the date in A2 is on or before January 1, 2025.

How do I highlight cells that are less than or equal to a value using conditional formatting?

Select the range, go to Home > Conditional Formatting > New Rule > Use a formula. Enter a formula like =A2<=100 (adjust the cell reference to the top-left of your selection), set a format, and click OK.

Why does my formula return FALSE when the numbers look equal?

This is often due to rounding. The displayed value may be rounded, but the underlying value has more decimal places. Use the ROUND function in the comparison: =ROUND(A2,2)<=ROUND(B2,2).

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →