/**
* @customfunction
*/
function COLORED(range) {
const book = SpreadsheetApp.getActiveSpreadsheet();
const formula = book.getActiveRange().getFormula();
const [skip, addr] = formula.match(/\((.*)\)/) || [undefined, undefined];
if(addr){
const range = (/!/.test(addr) ? book : book.getActiveSheet()).getRange(addr);
return range.getBackgrounds().map(row => row.map(cell => {
let res = ''
switch(cell){
case '#4285f4': res = 'Да';
break;
case '#ea4335': res = 'Нет';
break;
default:
break;
}
return res;
}));
}
return '-';
}