Excellent example of where a DATABASE formula can be used.
Steps:
1) Assign a range name (for example "data"

to range A1:C:10000. Allowing "extra" space is appropriate if your database will grow in size.
2) Set up a "criteria" (preferably on a separate sheet) that would include 4 cells. These 4 cells can be placed anywhere on the sheet, but for this example we'll use cells B2:C3, as follows...
In cell B2 and C2, copy the field names ("c1" and "c2"
In cell B3, enter "a" (no quotation marks)
In cell C3, enter "b" (no quotation marks)
3) Assign a range name (example "crit"

to the 4 cells.
4) Method of assigning a range name:
a) Highlight the cell or range
b) Hold down the <Control> key and hit <F3>
c) Type the name
d) Hit <Enter>
5) Enter the following database formula in whatever cell you require it...
=DSUM(data,3,crit)
The database formula consists of 3 parts:
a) reference to the "database"
b) reference to the "offset", or column from which you want to pull the numbers from (in this case "add"

.
c) reference to the range containing your "criteria".
Hope this helps.

. If you encounter any problems, I can email you example files that will provide a variety of different examples, including formulas, AND Excel's ability to use the same criteria to extract out those records "behind the formulas".
Regards, ...Dale Watson dwatson@bsi.gov.mb.ca