在Google表格中-我需要对一组数字求和,其中初始单元格包含定界符和非数字:
3; 6; 1; 3; None; 1; 1
我首先替换所有空格和非数字:
=REGEXREPLACE(AG24,"\D+",",")
给出:3,6,1,3,1,1
由于=SUM(3,6,1,3,1,1)
正确地提供了15,所以我想尝试将REGEXREPLACE
的结果传递到SUM()
并神奇地进行计算,但是这样做的结果是0:
=SUM(REGEXREPLACE(AG24,"\D+",",")) = 0
我有点期待...
我也尝试过SUMPRODUCT
,它也会产生0:
=SUMPRODUCT(ARRAYFORMULA(REGEXREPLACE(AG24,"\D+",","))) = 0
问题:那么我该如何求和字符串整数列表?