應用濾鏡時如何使 COUNTIF 僅計算可見記錄的小計

應用濾鏡時如何使 COUNTIF 僅計算可見記錄的小計

我想要COUNTIFBrand 3列的公式,並且如果過濾了COUNTIF對過濾條件的更改。

                    TOTAL COUNT 0        0          3   COUNTIF(H3:H5,"VoID")
Area    Region  Branch  Member  Brand 1  Brand 2    Brand 3 
East    NY        NY     1                           Void   
West    CA        LA     2                           Void   
North   IL      Chicago  3                           Void   

套用篩選器後,我得到相同的總計數,但需要將其設為 1(僅計算可見儲存格):

                    TOTAL COUNT 0        0          3   Answer needs to be 1
Area    Region  Branch  Member  Brand 1  Brand 2    Brand 3 
East    NY        NY    1                            Void   

答案1

你可以使用這個公式

=SUMPRODUCT(SUBTOTAL(3,OFFSET(H3,ROW(H3:H5)-ROW(H3),0)),(H3:H5="void")+0)

H3:H5這將為您提供(過濾後)“無效”的可見單元格的計數。

相關內容