我有一个电子表格,其中包含使用合并单元格的列,以便进行格式化 . 我正在尝试创建镜像第一组列的列,但在所有受影响的行上使用合并的单元格值 . 由于我在网上找到的自定义功能,我可以做到这一点 . 我不能做的就是在arrayformula中包含这个,我不知道为什么 .
自定义功能是:
/**
* Takes into account merged cells and returns the value of the merged cell
* for all the cells within the merged range, rother than just the top left
* cell of the merged range.
*
* Copied from https://webapps.stackexchange.com/questions/110277/how-do-i-reference-the-values-of-merged-cells-in-formulas
*
* Used by Patrick Duncan. - 7 May 2018
*/
function cellVal(cellAddress) {
var cell = SpreadsheetApp.getActiveSheet().getRange(cellAddress);
return (cell.isPartOfMerge() ? cell.getMergedRanges()[0].getCell(1, 1) : cell).getValue();
}
没有Arrayformula的公式是:
= cellVal2(index(address(row(),5,4)))
而我正在尝试的是:
= arrayformula(cellVal2(index(address(row(E3:E),5,4))))
知道我在这里做错了吗?
干杯,
帕特里克