Excel Use SUMIF to Add Values Based on Other Values

In this example, we have a list of people in Column A, and a list of hours in Column B:

Dave 2
Britney 3
Britney 1
Dave 4
Britney 2
Dave 3


To get all of Britney's hours, the formula is:

=SUMIF(A2:A7, "Britney", B2:B7)

The first part (A2:A7) indicates the data range to look for the value, the second part ("Britney") is the value to look for, and the third part (B2:B7) are the values to sum up.

This formula will show a result of 6, meaning Britney has 6 total hours in this dataset.