Highlight Cells That Begin (Or End) With In Excel – Excel & Google Sheets
Written by
Reviewed by
Last updated on July 9, 2022
This tutorial will demonstrate how to highlight cells that begin or end with certain text using Conditional Formatting in Excel and Google Sheets.
Highlight Cells that Begin With or End With
You can highlight cells where the value in the cell either begins or ends with certain text by creating a Conditional Formatting rule.
- Select the range you want to apply formatting to.
- In the Ribbon, select Home > Conditional Formatting > New Rule.
- Select Use a formula to determine which cells to format, and enter the following COUNTIF formula:
=COUNTIF(B4, "La*")
This will find out if the text starts with La—.
- Alternatively, to find out if the text in a cell ends with certain text, type in the formula:
=COUNTIF(B4, "*ke")
- Click on the Format button and select your desired formatting.
- Click OK, then OK again to return to the Conditional Formatting Rules Manager.
- Click Apply to apply the formatting to your selected range and then click Close.
Highlight Cells That Begin or End With – Google Sheets
The process to highlight cells where the value in the cell either begins or ends with certain text in Google sheets is like the process in Excel.
- Highlight the cells you wish to format, and then click on Format > Conditional Formatting.
- The Apply to Range section will already be filled in.
- From the Format Rules section, select Custom Formula from the drop-down list and type in the following formula to look for text at the beginning of your cell.
=COUNTIF(B4, "La*")
- Alternatively type in this formula to look for text at the end of your cell.
=COUNTIF(B4, "*ke")
- Select the fill style for the cells that meet the criteria.
- Click Done to apply the rule.