例如,我怎样才能找到更快的公式?
=SUMPRODUCT((Data!D:D="RC Corp")*(Data!AD:AD="Expected Allowances / Provisions"))
VS
=COUNTIFS(Data!D:D,"RC Corp",Data!AD:AD,"Expected Allowances / Provisions")
Vs 将 2 个字段连接到一个新列中并做
Z1 = D1&AD1
=Countif(Data!Z:Z,"RC CorpExpected Allowances / Provisions")
与 VBA
Dim i as integer
Dim Total as integer
Total = 0
i=0
While i < 1000
IF Range("D"&i).Value = "RC Corp" AND Range("AD"&i).Value = "Expected Allowances / Provisions" Then
Total = Total + 1
End If
Wend
Range("$A$1").Value = Total