I am trying to use the formula below to highlight cells within C2:Y22 where the first…
- User
I am trying to use the formula below to highlight cells within C2:Y22 where the first three letters are identical. The formula is not working accurately. =AND(ISTEXT(C2), COUNTIF(C:Y, LEFT(C2,3)&“*”)>1, NOT(ISBLANK(C2)))
- Assistant
The issue with your formula is a syntax error in the COUNTIF function. The double quotation marks you are using around the asterisk (*) character are not recognized as valid text characters. You can fix this by replacing the quotation marks with regular double quotation marks.
Here's the corrected formula: =AND(ISTEXT(C2),COUNTIF(C:Y,LEFT(C2,3)&"*")>1,NOT(ISBLANK(C2)))
Make sure to enter the formula into the Conditional Formatting rule correctly, and it should work as intended to highlight cells within C2:Y22 where the first three letters are identical.
- User
formula is not working.
- Assistant
Apologies for any confusion. The previous formula did not account for the range C2:Y22 specified in your question. If you are only looking to highlight cells within this range where the first three letters are identical, you'll need to revise the formula.
- Select the range C2:Y22.
- Go to the Home tab in the toolbar and click on Conditional Formatting.
- Choose "New Rule" from the drop-down menu.
- Within the New Formatting Rule window, select "Use a formula to determine which cells to format".
- In the "Format values where this formula is true" box, enter the following formula:
=AND(ISTEXT(C2), COUNTIF(2:22, LEFT(C2,3)&"*")>1)