WorksheetFunction.SumIfs (Excel)

Adds the cells in a range that meet multiple criteria.

Each cell in sum_range is summed only if all the corresponding criteria specified are true for that cell. Cells in sum_range that contain TRUE evaluate as 1; cells in sum_range that contain FALSE evaluate as 0 (zero). You can use the wildcard characters, question mark (?) and asterisk (*), in criteria. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character. Each criteria_range does not have to be the same size and shape as sum_range. The actual cells that are added are determined by using the top, left cell in that criteria_range as the beginning cell, and then including cells that correspond in size and shape to sum_range. For example:

SumIfs (Arg1, Arg2, ..., Arg29)


Dim dblSumIfs As Double
dblSumIfs = WorksheetFunction.SumIfs(Arg1:=, Arg2:=, Arg3:=)

Arguments

Arg1, Arg2, ..., Arg29

Arg1 (Range) - Sum_range - the range to sum.

Arg2 (Range) - Criteria_range1, criteria_range2... - One or more ranges in which to evaluate the associated criteria.