Dear friends of the forum, greetings ...
I have some results whose cell has a green background and other red ones. I would like to be able to assign the value of 0 to all cells with a red background and 1 to those with a green background
I have the code that allows me to place a colored background but I don't know how to make the code GAS for a conditional for this case.
function setBackground(color) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[6]; //sheet 6
var range = sheet.getRange("O2:Q5");
range.setBackground("#ff0000");
}
The letters you see in each cell are not necessary but the value assigned according to the color.
I attached an image for you to see
I thank you in advance for your valuable collaboration.