how to change cell color in google spreadsheet if statement code example
Example: google sheet color one column based on another column
Highlight Cells Using Conditional Formatting Based on Another Cell Value in Google Sheets
Select the cells that have the names (A2:A11).
Go to the Format Tab.
Click on Conditional Formatting.
In the Conditional Formatting rules pane, select Single Color.
From the 'Format Cells if' drop down, select 'Custom Formula is'.
Add your formula e.g. '=b2<15'
Select color for the condition match