Working with Excel, sometimes you would like to make a sum that only comes with specific cells (using SUMIF function), or calculate only specific cells in a row or column (using COUNTIF function).
Source: Totaling Cells Conditionally By Using SUMIF Function in Excel