The SUMIF function adds all the numbers with the criteria you specified.
Formula:
=SUMIF(range, criteria, [sum_range])
Explanations:
– The range is required, which is the criteria range.
– The criterion is required, the criteria for the sum.
– Sum_range is optional, the cells to add together.
Cautions:
– Wildcard characters (the question mark ?) and (asterisk *) can be used in the criteria argument.
– Only one given criterion is used. Please see SUMIFS when there are multiple criteria.
Example 1: what is the total income for all Males?
=SUMIF(A2:A11,"M", B2:B11), the result returns $338,000.
Example 2: what is the total income for all Females?
=SUMIF(A2:A11, "F", B2:B11), the result returns $542,000.