使用 Countif、Countblank 等函数来引用不连续的范围。

Som*_*Guy 6 worksheet-function array microsoft-excel microsoft-excel-2010

有没有办法使用数组公式或其他一些功能来本质上拥有一个 excel 函数,这意味着。

=Countblank({A1,A4:A6,A112:127,B29:B38})  etc.
Run Code Online (Sandbox Code Playgroud)

本质上,我想引用您通常会在其中键入连续范围的多个位置。如果确实可能,则首选非 VBA。

我知道我可以使用

=Countblank(A1)+Countblank(A4:A6)+Countblank(A112:127)+Countblank(B29:B38) 
Run Code Online (Sandbox Code Playgroud)

在这种情况下,但由于显而易见的原因,它并不理想。

谢谢大家 :)

Ant*_*ony 1

通过使用 INDIRECT 函数,您可以创建一个范围数组,然后与 SUM 中包含的 COUNTBLANK 一起使用应该给出所需的结果。

=SUM(COUNTBLANK(INDIRECT({"A1","A4:A6","A112:A127","B29:B38"})))
Run Code Online (Sandbox Code Playgroud)

除了 COUNTBLANK 之外,您还可以使用空的 COUNTIF 条件。

=SUM(COUNTIF(INDIRECT({"A1","A4:A6","A112:A127","B29:B38"}),""))
Run Code Online (Sandbox Code Playgroud)