How to Highlight Cells or Rows When a Cell Contains Yes in Excel
Question details
The user wants to apply conditional formatting to highlight specific cells or entire rows based on whether a target cell in a corresponding column contains the word "Yes" or begins with the letter "Y".

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Formatting a dataset to visually distinguish rows or ranges where a specific column's value meets a text criterion.
- Observed behavior
- The user needs a reliable method to apply a formula-based conditional formatting rule across multiple columns based on the text value in a single column.
Ensure your dataset is organized in clear columns and rows without merged cells, and identify the exact column containing the "Yes" values you want to use as the formatting trigger.
Use a Conditional Formatting Formula to Highlight the Range
Create a custom conditional formatting rule using an absolute column reference to highlight rows or multiple columns based on a single target column's text value.
By using a formula in conditional formatting, you can evaluate the value of one cell (like I7) and apply a background color to an entire row or a selected range of columns (like H7:L16). The key is to lock the column letter with a dollar sign ($) so the formatting rule always checks the correct column.
Highlight the cells or rows you want to color, such as H7:L16. It is crucial that the active cell (the one you start dragging from) is in the first row of your selection, such as H7.
Navigate to the Home tab on the Excel ribbon, click on Conditional Formatting, and select New Rule from the dropdown list.
Choose 'Use a formula to determine which cells to format'. In the formula input box, enter `=LEFT($I7)="Y"` if you want to highlight cells where column I starts with 'Y'. If you want an exact match for 'Yes', use `=$I7="Yes"` instead.
Click the Format button, go to the Fill tab, and choose the color you want to apply to the highlighted rows. Click OK twice to confirm and apply the rule.

Highlight Cells Based on Text Criteria with WPS Spreadsheet
WPS Spreadsheet offers a powerful and intuitive Conditional Formatting feature, allowing you to highlight rows, columns, or specific cells based on text values like "Yes" quickly and accurately.
- 1. Open your file and select data: Open your workbook in WPS Spreadsheet and highlight the data range you want to format (e.g., H7:L16).
- 2. Access Conditional Formatting: Go to the Home tab, click on Conditional Formatting, and choose New Rule.
- 3. Choose the formula option: Select 'Use a formula to format cells' from the rule type options.
- 4. Input the highlighting formula: Type your formula, such as `=$I7="Yes"` or `=LEFT($I7)="Y"`, ensuring the row number matches the first row of your selection.
- 5. Set the visual format: Click Format to pick a background fill color, then click OK to apply the highlighting to your dataset.

Frequently Asked Questions
Why is my conditional formatting highlighting the wrong rows?
This usually happens if the row number in your conditional formatting formula does not match the active cell of your selected range. For example, if you highlight the range starting from row 7 (H7:L16), your formula must reference row 7 (e.g., =$I7="Yes").
How do I highlight the entire row instead of just a few columns?
To highlight the entire row, click and drag over the row numbers on the far-left side of the sheet to select the whole rows before applying the rule. Then, use the exact same formula with an absolute column reference, like =$I7="Yes".
Can I highlight cells if they contain part of a word instead of an exact match?
Yes, you can use the SEARCH function within your formula to find partial matches. For example, using the formula `=ISNUMBER(SEARCH("Yes",$I7))` will highlight the row if the word "Yes" appears anywhere within the text of cell I7.




