This operation can be done with the more efficient SUMIFS function.