Formula Errors

How to Exclude Blank Cells from Less-Than Conditional Formatting

Emma BrownEmma Brown Nov 10, 2026 868 views

Question details

The user needs to prevent empty cells from being highlighted when applying a less-than conditional formatting rule to a data range.

How to Exclude Blank Cells from Less-Than Conditional Formatting
Product
Excel
Device & OS
not provided
Scenario
Applying conditional formatting to dynamically highlight cells containing values less than a specific threshold or reference cell.
Observed behavior
Blank cells are incorrectly highlighted by the rule because the spreadsheet software treats empty cells as having a value of zero, which satisfies the less-than condition.
Before you start

Determine the exact range of cells you want to format and identify the specific threshold value or reference cell for your less-than condition.

Solution 1Recommended

Use a Formula-Based Conditional Formatting Rule

Create a custom rule using the AND function to verify both the less-than condition and that the cell is not blank simultaneously.

By default, spreadsheet applications treat empty cells as zero. To prevent this from triggering less-than formatting rules, you can combine your primary condition with a check for blank cells using an AND formula.

1
Select the target range

Highlight the range of cells where you want the conditional formatting to appear.

2
Open Conditional Formatting rules

Navigate to the Home tab on the top ribbon, click on 'Conditional Formatting', and select 'New Rule' from the dropdown menu.

3
Choose the formula option

In the New Formatting Rule dialog box, select 'Use a formula to determine which cells to format'.

4
Enter the AND formula

Type your formula into the provided field. For example, enter =AND(H7<F7, H7<>""). Replace H7 with the first cell in your selected range, and F7 with your reference criteria.

5
Set the format and apply

Click the 'Format' button, choose your desired fill color or font style, click 'OK', and then click 'OK' again to apply the rule to your selection.

Use a Formula-Based Conditional Formatting Rule
Understanding the syntax: In the formula =AND(H7<F7, H7<>""), the <> symbol means 'not equal to', and the "" represents an empty string. This ensures only non-blank cells that meet your criteria get formatted.
Efficient Data Formatting in WPS Spreadsheet

Manage Conditional Formatting Easily with WPS Office

WPS Spreadsheet features an intuitive Conditional Formatting manager, allowing you to easily set up complex rules, handle blank cells, and visualize your data accurately. It is a fully featured, lightweight, and powerful alternative for all your spreadsheet needs.

  1. 1. Open your spreadsheet: Launch WPS Spreadsheet and open the document containing your data.
  2. 2. Select range and access formatting: Highlight the cells you want to analyze, then go to the Home tab and click 'Conditional Formatting'.
  3. 3. Apply formula rule: Select 'New Rule' > 'Use a formula...', and input your =AND() condition to exclude blank cells.
  4. 4. Customize and save: Pick your desired cell highlight color from the Format menu and click OK to instantly update your spreadsheet.
Fully compatible with Microsoft Excel formats (.xlsx, .xls) and complex formatting rules.Intuitive Conditional Formatting manager to easily arrange rule priorities and conditions.Lightweight software that runs efficiently even on older devices.Familiar ribbon interface ensures a zero learning curve for new users.
microsoft office alternative - wps office

Frequently Asked Questions

Why do spreadsheet programs treat blank cells as zeros?

Spreadsheet applications generally evaluate empty cells as zero during numeric calculations or logical tests. This prevents widespread calculation errors across formulas but can unintentionally trigger formatting rules that look for values below a certain positive number.

Can I use the standard 'Highlight Cells Rules' instead of a formula?

The standard 'Less Than' rule from the quick menu only accepts a single condition. It cannot simultaneously check if a cell is less than a value AND not blank. Using the formula method or adding a higher-priority 'Stop If True' rule for blanks are the required workarounds.

Will this conditional formatting formula work in WPS Spreadsheet?

Yes. WPS Spreadsheet fully supports standard spreadsheet formula logic and conditional formatting rules. The =AND(H7<F7, H7<>"") formula will work identically and seamlessly.

What should I do if my formula rule isn't working correctly across the whole column?

Check your cell references. When entering the formula, ensure you are referencing the top-left cell of your selected range without absolute dollar signs (e.g., use A1 instead of $A$1). This allows the rule to dynamically adjust for every cell in your selection.