When you need to perform simple arithmetic calculations on several ranges of cells, sum the results, and use criteria to determine which cells to include in the calculations, consider using the SUMPRODUCT function. SUMPRODUCT takes arrays and arithmetic operators as arguments. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.