Then use the 'sumproduct' or the 'sumifs' formula