Possible Duplicate:

Sum Values in One Range Based on Criteria in Another

I have several columns in a spreadsheet with *date*, *item*, *order* etc. but also 2 columns:

- Column
`K`

–*Owed By* - Column
`L`

–*Owed Amount*

In column `K`

there will be a couple of different names, say, "Joe" and "Andy", and in column `L`

will be the amount they owe for a particular item.

In another Column, I have *Totals for Each Name*, and I basically need a formula that will look at Column `K`

see if the name is "Joe" and add the total he owes; then I will change the formula for other names.

Any idea how to go about this?

## Best Answer

Using the

`SumIf`

formula would be appropriate in this case.would get you the sum over all the cells that match with "Joe"

If you have lots of names it can be tedious to edit the second term in the formula: you can also use a cell reference here. If you have a list of (unique) names you want to find the totals for in -say- M5:M25 you can enter the formula

in N5 and then copy it down through the range N5:N25