Look to use the Sumifs function
http://www.techrepublic.com/blog/mso...-in-excel/6538