Sarah,
With database formulas (=DSUM, =DCOUNTA, etc) one is able to create "whatever" complex criteria is necessary. This includes "compound conditions" - for example, including "AND", "OR", "NOT", etc, and even other functions such as VLOOKUP.
Thus, the criteria can generate the totals for precisely the situation you've described, and MUCH MORE... if required.
If you'd like "specific" help, you could email me your file and I'll modify and return it. If you have sensitive data, perhaps you could replace it with fictitious data that still reflects the type of data you're working with.
Alternatively, or in addition, I can email you example files.
ALL Excel users should DEFINITELY take advantage of Excel's database functions. They are indeed EXTREMELY POWERFUL, and provide MUCH MORE flexibility and "ANALYSIS CAPABILITY" than is offered by other options.
Hope this helps.
Regards, ...Dale Watson dwatson@bsi.gov.mb.ca