我想知道这个公式有什么问题。
=LET(SheetNames,{"Jan","Feb"},SUMPRODUCT((TEXT(INDIRECT("'"&SheetNames&"'!B2:B25"),"DDD"))=LEFT(C$2,3)*(INDIRECT("'"&SheetNames&"'!A2:A25")="DAY")))
注释。
Jan, Feb ..sheet names
Cell B2:B25 in all sheets ...mixed data including date
Cell B2:B25 in all sheets ...mixed data including date
给我#VALUE!
我想知道这个公式有什么问题。我试过了。
您不能以这种方式将
INDIRECT
函数与数组一起使用。仅用单细胞就有可能。MAP
或 REDUCE
:
=SUM(MAP({"Jan","Feb"},LAMBDA(mo,SUMPRODUCT((TEXT(INDIRECT("'"&mo&"'!B2:B25"),"DDD")=LEFT(C$2,3))*(INDIRECT("'"&mo&"'!A2:A25")="DAY")))))
或
=REDUCE(0,{"Jan","Feb"},LAMBDA(a,mo,a+SUMPRODUCT((TEXT(INDIRECT("'"&mo&"'!B2:B25"),"DDD")=LEFT(C$2,3))*(INDIRECT("'"&mo&"'!A2:A25")="DAY"))))