如果该单元格具有特定的颜色,那么我希望它在单独的单元格中输出值。
不太确定如何定义cellcolor /类似功能。
例如:
=IF(CELLcolour(K2)=22,"Y","N")
答案 0 :(得分:1)
您可以使用脚本来完成。转到工具>脚本编辑器,然后使用以下代码:
function getCellColor(x) {
var formula = SpreadsheetApp.getActiveRange().getFormula();
formula = formula.substring(formula.indexOf("(")+1, formula.indexOf(")"));
color = SpreadsheetApp.getActiveRange().getSheet().getRange(formula).getBackground();
return color;
}
然后您可以使用公式获取单元格的背景色
=getCellColor(A1)
在您的Google表格中。这仅适用于单元格,而不适用于范围。