Google-sheets – Format a Cell with Script

conditional formattinggoogle sheetsgoogle-apps-script

I need to write a script to see if a cells value is found in an array, and if it is change the background color of that cell. Can't do this with "Conditional Formatting" as it needs to compare with 25 – 30 values.

Best Answer

If I understand you correctly, this can be achieved with conditional formatting in New Google Sheets:

WA57294 example

The above with Format > Conditional formatting..., Custom formula is

=countif($H$1:$H$5,A1)  

Background checked and yellow chosen, with Range: A1:F6.