Add up a value that meets 2 criteria

L

Lee

I have an inventory list where different people check out certain products.
I need to be able to have a formula that adds the value of a certain product
for a certain salesman. This is an example of what I have.

Date Product Amount salesperson
10-Oct Pencil 5 Jacob
15-Oct Pen 10 Brian
16-Oct Paper 2 Brian
20-Oct Pencil 11 Jacob
25-Oct Pencil 7 Brian

and i want it to show that for this month Jacob sold a total of 16 pencils.
 
J

John C

Assume Dates (for multiple months) in cells A2:A500, product in cells
B2:B500, amount in cells C2:C500, and salesperson in cells D2:D500
Criteria would be in cells F2 for date (entered as mm/1/yy), F3 for product,
and F4 for salesperon.
=SUMPRODUCT(--(YEAR(A2:A500)=YEAR(F2)),--(MONTH(A2:A500)=MONTH(F2)),--(B2:B500=F3),--(D2:D500=F4),(C2:C500))
 
L

Lee

It is showing a "#VALUE!"

John C said:
Assume Dates (for multiple months) in cells A2:A500, product in cells
B2:B500, amount in cells C2:C500, and salesperson in cells D2:D500
Criteria would be in cells F2 for date (entered as mm/1/yy), F3 for product,
and F4 for salesperon.
=SUMPRODUCT(--(YEAR(A2:A500)=YEAR(F2)),--(MONTH(A2:A500)=MONTH(F2)),--(B2:B500=F3),--(D2:D500=F4),(C2:C500))
 
D

David Biddulph

It sounds as if at least one of the cells the relevant ranges has text,
rather than a number. Check for spaces, non-breaking spaces [CHAR(160)],
and other non-printing characters.
 
J

John C

Can you copy/paste your exact formula?
Also, have you verified that all dates are actually entered as dates?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top