Add numbers in column IF other column contains x
I have to columns of numbers. The numbers in column "B" define those in column "A" by colour ( or color).
| number | colour |
|---|---|
| 2 | blue |
| 3 | red |
| 7 | green |
| 5 | blue |
I want to know the sum of the numbers in A where they are blue. The correct answer here is "7". So I must want something along the lines of A6=SUM A2..A5 WHERE B2..B5 is "blue". Or am I pointing in the wrong direction?!