What would the formula look like if I wanted to count the amount spent for various charges throughout the year.

For example:

---A------B---
1 2001 $500
2 2001 $650
3 2002 $513
4 2003 $768
5 2003 $661
6 2004 $110
7 2005 $1056
8 2005 $809

So to count for 2003, what would the formula have to be that included looking in the whole range of valuve?