Use the SUMIF function to sum the values in a range that meet criteria that you specify.

  1. Select a cell.

  2. Type =SUMIF(.

  3. Click and drag the cells you to analyze.

  4. Enter the category you want to find.

  5. Click and drag the cells for the range.

  6. Press Enter.



Source: Microsoft