I am looking for help with If and then functions.

I am making a spreadsheet to track customers expenses by the division they are in. I have a list of customers in Column A, each assigned to a particular division in Column B (may have many duplicates), and how much each spent in Column C. I want to keep a running total of the amount each division spends. So off to the side, starting in say E4, I would have a division name and next to it in E5, a sum of all the money spent from the customers in Column A that are assigned to that division.

If a cell A2 has a particular name, assigned to a division in B2 and then a dollar amount in c2, What is the formula to put in E5?

Hope this makes sense.

Thanks in advance for any help.