This problem can be solved with the SUMIFS function and the COUNTIFS function, as explained below.

For convenience,age(E5:E16) andamount(D5:D16) arenamed ranges.

SUMIFS function

TheSUMIFS functionis designed to sum cells that meet multiple criteria.

Excel formula: Sum if multiple criteria

SUMIFS takes at least three arguments like this:

Noticesum_rangeappears first.

SUMIFS is in agroup of eight functionsthat share this syntax.

The difference is that COUNTIFS does not have asum_rangeargument.

Excel formula: Subtotal by color

Criteria can be applied to dates, numbers, and text.

Excel formula: Dynamic summary count

Excel SUMIF function

Excel COUNTIFS function

Article image

Article image