Question: I am facing a problem that seems trivial in Excel. What I need to do is simply this:

[![https://i.imgur.com/kxZlXeo.png](https://i.stack.imgur.com/Z3OC8.png)](https://i.stack.imgur.com/Z3OC8.png)

In short, I have a large file of prices linked to a few people and I need to know how much each person paid. I've tried things with VLOOKUP with not much success.

How can I accomplish this?

Answer: 
You need `SUMIF()` formula.

In your specific case `=SUMIF(B$2:B$9;D4;A$2:A$9)` will give you the sum for `Name1` then paste it down for `Name2` and `Name3`

[![Table](https://i.stack.imgur.com/UmjwP.jpg)](https://i.stack.imgur.com/UmjwP.jpg)
**SUMPRODUCT** function can help you get the result:

```
=SUMPRODUCT(($B$2:$B$9=E4)*($A$2:$A$9))

```

[![enter image description here](https://i.stack.imgur.com/pFk8m.png)](https://i.stack.imgur.com/pFk8m.png)