我在任何地方都研究过这个问题,但我找不到对我的特殊情况的答案。
这是我的SumIfs语句。
B_white = Application.SumIfs(Range("G84:G" & LastRow), Range("G84:G" & LastRow), "1", Range("K84:K" & LastRow), "B*", Range("L84:L" & LastRow), "2 (test)")对于最后的标准,它需要查找"2 (test)“或"2”,但我不能使用"2*“,因为其中会有"22”和"28“的单元格。
如何更改这个SumIfs语句,使其查找"2 (test)“或"2"?
发布于 2017-03-21 16:16:22
B_white = Application.Sum(Application.SumIfs(Range("G84:G" & LastRow), Range("G84:G" & LastRow), "1", Range("K84:K" & LastRow), "B*", Range("L84:L" & LastRow), Array("2 (test)", "2")))发布于 2017-03-21 15:57:09
您可以使用数组版本的Sumproduct尝试SumIfs。
B_white = Application.SumProduct(Application.SumIfs(Range("G84:G" & LastRow), _
Range("G84:G" & LastRow), "1", Range("K84:K" & LastRow), "B*", _
Range("L84:L" & LastRow), Array("2", "2 (test)")))
' ^^^^^^^^^^^^^^^^^^^^^^https://stackoverflow.com/questions/42931598
复制相似问题