Reputation: 21
I have two columns: Category and Score. E.g.
Category | Score
Math | 3
Science | 2
Math | 4
History | 3
Art | 1
Science | 1
History | 5
Science | 3
Art | 2
I would like to have a cell that searches for all of the scores for History and sum that up. What would be the appropriate loop, if, and sum functions in Excel for that? Thanks!
Upvotes: 1
Views: 49
Reputation: 4015
You are looking for the SUMIF
function.
Try this: =SUMIF(A:A,"History",B:B)
That will search all of column A for "History" and sum all of column B if "History" is found.
Make sure there are no trailing spaces after "History" (such as "History ") else you will want to clean that up or use a wildcard like so =SUMIF(A:A,"History*",B:B)
Upvotes: 1