In the above screenshot, the formulas used is:
range (A4:A9) – The range of cells that will be tested against the criteria.
criteria (D4:D5) – The criteria to be used to test on range e.g. sum if equal to product A and B.
[sum_range] (B4:B9) – The range of cells to be sum against the criteria.