How to Exclude Blank Cells from Less-Than Conditional Formatting
Question details
The user needs to prevent empty cells from being highlighted when applying a less-than conditional formatting rule to a data range.

- 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.
Determine the exact range of cells you want to format and identify the specific threshold value or reference cell for your less-than condition.
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.
Highlight the range of cells where you want the conditional formatting to appear.
Navigate to the Home tab on the top ribbon, click on 'Conditional Formatting', and select 'New Rule' from the dropdown menu.
In the New Formatting Rule dialog box, select 'Use a formula to determine which cells to format'.
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.
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.

Create a Higher-Priority Blank Cell Rule
Set up an overriding rule specifically for empty cells that applies no formatting and prevents subsequent rules from running.
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. Open your spreadsheet: Launch WPS Spreadsheet and open the document containing your data.
- 2. Select range and access formatting: Highlight the cells you want to analyze, then go to the Home tab and click 'Conditional Formatting'.
- 3. Apply formula rule: Select 'New Rule' > 'Use a formula...', and input your =AND() condition to exclude blank cells.
- 4. Customize and save: Pick your desired cell highlight color from the Format menu and click OK to instantly update your spreadsheet.

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.




