How to format a cell to turn a color based on the text value of a cell that corresponds to a list of text values

StackOverflow https://stackoverflow.com/questions/22818512

  •  26-06-2023
  •  | 
  •  

Pregunta

In cells A1:A500 I have names like "Fred Flintstone" for example. In cells B1:B500, I have a drop down box that indicates "PASS" or "FAIL". In cells AA1:AA500 I have created a formula that will pull only the names from A1:A500 that have "FAIL" in their respective B1:B500 column.

What conditional formula could I use so that in cells C1:C500, they will turn yellow if there is a name on the list of names that is contained in AA1:AA500?

So if A1 equals "Fred Flintstone" and he is a "FAIL" in B1, his name gets put into AA1. I then need Cell C1 to turn yellow based on the fact that his name appeared on the AA list.

¿Fue útil?

Solución 2

Click on cell C1 and apply conditional formatting with the "formula is" option:

=COUNTIF(AA:AA,A1)=1

and pick yellow as the background color.

Then copy C1 and PasteSpecialFormats to the rest of column C

Otros consejos

You can use MATCH to see if the name appears in column AA. I suggest something like this:

  1. Select the cells to be highlighted (make sure that you start with cell C1 to make it the active cell).

    enter image description here

  2. Insert the MATCH formula, wrapped in ISNUMBER to get a boolean value. MATCH returns a number (the row number of a match) or an error (if there are no matches):

    enter image description here

    =isnumber(match(A1,AA$1:AA$500,0))
    

    And make sure you have the appropriate format picked.

  3. Click OK and you should be done:

    enter image description here

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top