Formatting Issues

Highlight Cells in Excel Based on Text and Numeric Values

Bushra ParveenBushra Parveen Dec 2, 2026 869 views

Question details

Highlight a cell in column C based on text in column A and whether the corresponding cell in column B is numeric.

Highlight Cells in Excel Based on Text and Numeric Values
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.
Before you start

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.

Solution 1Recommended

Create two formula-based conditional formatting rules in Excel

Use separate rules to flag each HOME and AWAY condition in column C.

1
Select the target cells

Select C1 or a range such as C1:C100. If your range starts on a different row, use that row number in both formulas.

2
Create the HOME rule

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))).

3
Choose a format

Select Format, choose a fill color, and click OK to save the HOME rule.

4
Create the AWAY 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.

5
Check the applied range

Open Conditional Formatting > Manage Rules and confirm that both rules apply to your intended column C range.

Create two formula-based conditional formatting rules in Excel
How the formulas interpret values: SEARCH matches text regardless of case and can find HOME or AWAY within longer text. ISNUMBER treats blank cells and numbers stored as text as nonnumeric.
WPS Spreadsheet conditional formatting

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. 1. Open and select the range: Open the workbook in WPS Spreadsheet and select C1 or the target range, such as C1:C100.
  2. 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. 3. Set the HOME format: Choose a fill color in the rule's format settings and confirm the rule.
  4. 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.
Flag HOME and AWAY conditions with two formula-based rulesOpen and edit Microsoft Excel XLSX and XLS filesChoose a fill color to make flagged cells easy to spot
microsoft office alternative - wps office

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.