The Analysis ToolPak is an Excel add-in program that provides data analysis tools for financial, statistical and engineering data analysis.
To count the number of cells that contain numbers, use the COUNT function.
To count cells based on one criteria (for example, higher than 9), use the following COUNTIF function.
To count cells based on multiple criteria (for example, green and higher than 9), use the following COUNTIFS function.
To sum a range of cells, use the SUM function.
To sum cells based on one criteria (for example, higher than 9), use the following SUMIF function (two arguments).
To sum cells based on one criteria (for example, green), use the following SUMIF function (three arguments, last argument is the range to sum).
To sum cells based on multiple criteria (for example, blue and green), use the following SUMIFS function (first argument is the range to sum).
General note: in a similar way, you can use the AVERAGEIF and AVERAGEIFS function to average cells based on one or multiple criteria.
count-sum-functions.xls