How to Highlight an Excel Header When Its Column Contains Data in WPS Office
Question details
The user needs a conditional formatting rule that automatically highlights a header cell when any data is entered below it in the same column.

- Product
- WPS Office Spreadsheets
- Device & OS
- not provided
- Scenario
- The user is working with a horizontal header range such as D2:Z2 and wants each header to become highlighted only when its own column contains data.
- Observed behavior
- The desired behavior is for each header cell to highlight automatically when the corresponding column below it contains data.
Make sure your header row occupies a single horizontal range such as D2:Z2, and identify the active cell in that selection, usually D2. Also confirm the row range you want to monitor below the headers, for example D3:D1000.
Create a COUNTA Conditional Formatting Rule for the Header Range
Use this method when you want each header in a horizontal range to highlight automatically as soon as any value appears below it.
The formula =COUNTA(D3:D1000)>0 checks whether any cell in D3:D1000 is non-blank. Because the rule is applied to D2:Z2 with D2 as the active cell, WPS Spreadsheets adjusts the column reference relative to each header, so E2 checks E3:E1000, F2 checks F3:F1000, and so on.
Select the header range, for example D2:Z2. Make sure D2 is the active cell in the selection before creating the rule.
Go to the Home tab, click Conditional Formatting, and then choose New Rule.
In the New Formatting Rule dialog, select Use a formula to determine which cells to format.
In the formula box, type =COUNTA(D3:D1000)>0, then click Format to choose a fill color or other highlight format and confirm with OK.
Click OK to apply the rule. Enter text, a number, or another value in any monitored cell below a header to confirm that only that header highlights.

Highlight Header Cells Automatically in WPS Spreadsheets
Apply the same relative COUNTA rule in WPS Spreadsheets to make header cells highlight when their column contains data, without macros or manual formatting.
- 1. Open your workbook: Open the target workbook in WPS Spreadsheets.
- 2. Select the header range: Select D2:Z2 and make sure D2 is the active cell.
- 3. Create a new conditional formatting rule: Go to Home > Conditional Formatting > New Rule, then select Use a formula to determine which cells to format.
- 4. Enter the COUNTA formula: Enter =COUNTA(D3:D1000)>0 and click Format to choose the highlight style.
- 5. Save and test: Click OK to apply, then type data below a header to verify that only the corresponding header highlights.

Frequently Asked Questions
Why does the header highlight when I enter data below only one column?
Because the rule uses a relative column reference. When D2 is active, =COUNTA(D3:D1000)>0 adjusts for each selected header, so each header checks only the column directly below itself.
Will this work for text, numbers, and formula results?
Yes. COUNTA counts any cell that is not empty, including text, numbers, dates, formula results, and even cells that contain an error value.
How do I change the header highlight color later?
Select the header range, go to Home > Conditional Formatting > Manage Rules, select the rule, and click Edit Rule to open the Format options again.
Can I use a different row range instead of D3:D1000?
Yes. Adjust the formula range to match your data area, such as =COUNTA(D3:D500)>0. Keep the starting column reference relative to the active header cell.
Does this conditional formatting rule work in Microsoft Excel as well?
Yes. The same COUNTA-based rule works in WPS Spreadsheets and Microsoft Excel, and the formatting is preserved when you save the file in .xlsx format.




