WPS按颜色求和通用函数来啦!
=SumByColor(C5,A1:E15)


/*功能:按颜色求和作者:E精精*/functionSumByColor(colorRng, dataRng) {let total = 0;// 提取颜色的函数const getColor = (cell) => cell.Interior.Color;const targetColor = getColor(colorRng);// 使用 for...of 遍历单元格for (var cell of dataRng) {if (getColor(cell) === targetColor) {total += cell.Value2 || 0;}}return total;}



夜雨聆风