Highlight Cells in Excel Based on Text and Numeric Values
Question details
Highlight a cell in column C based on text in column A and whether the corresponding cell in column B is numeric.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Apply conditional formatting to flag HOME rows with a nonnumeric value in column B and AWAY rows with a numeric value in column B.
- Observed behavior
- Column C should be highlighted when either specified condition is true for the same row.
Identify the rows you want to format and check whether values in column B are stored as numbers or text. The formulas below assume the selected range starts at row 1.
Create two formula-based conditional formatting rules in Excel
Use separate rules to flag each HOME and AWAY condition in column C.
Select C1 or a range such as C1:C100. If your range starts on a different row, use that row number in both formulas.
On the Home tab, select Conditional Formatting > New Rule > Use a formula to determine which cells to format. Enter =AND(ISNUMBER(SEARCH("HOME",$A1)),NOT(ISNUMBER($B1))).
Select Format, choose a fill color, and click OK to save the HOME rule.
With the same column C range selected, open Conditional Formatting > New Rule and choose the formula option again. Enter =AND(ISNUMBER(SEARCH("AWAY",$A1)),ISNUMBER($B1)), choose a format, and click OK.
Open Conditional Formatting > Manage Rules and confirm that both rules apply to your intended column C range.

Highlight matching rows with WPS Spreadsheet
Use formula-based conditional formatting in WPS Spreadsheet to highlight column C according to the text in column A and the value type in column B.
- 1. Open and select the range: Open the workbook in WPS Spreadsheet and select C1 or the target range, such as C1:C100.
- 2. Add the HOME rule: On the Home tab, open Conditional Formatting and create a new formula-based rule. Enter =AND(ISNUMBER(SEARCH("HOME",$A1)),NOT(ISNUMBER($B1))).
- 3. Set the HOME format: Choose a fill color in the rule's format settings and confirm the rule.
- 4. Add the AWAY rule: Create another formula-based rule for the same range using =AND(ISNUMBER(SEARCH("AWAY",$A1)),ISNUMBER($B1)). Choose a format and confirm it.

Frequently Asked Questions
How do I apply the rules starting on row 2?
Select a range such as C2:C100 and change $A1 and $B1 to $A2 and $B2 in both formulas. The row references should match the first row of the selected range.
Does the HOME rule highlight a row when column B is blank?
Yes. ISNUMBER returns FALSE for a blank cell, so the HOME rule treats it as nonnumeric.
Will a number stored as text count as numeric?
No. ISNUMBER treats a number stored as text as nonnumeric. Convert the value in column B to a number if it should count as numeric.
Do HOME and AWAY have to be the only text in column A?
No. SEARCH finds HOME or AWAY within longer text and is not case-sensitive.




