I want a spreadsheet function that will produce a sum of all values in column B for when column A is equal to 'X' and when it is equal to 'Y'
A B
X 10
Y 3
X 7
X 22
Y 4
Y 9
The output should look like the following (where 39 & 16 are the results of the formulas):
X 39 -> 10 + 7 + 22
Y 16 -> 3 + 4 + 9