SUMIF positive values only from database

G

gmac

I want to sum all the positive values from a database for a singl
criteria.

e.g. database is,
fruit buy/sell quantity
apples -5
oranges 2
apples 3
apples 1

I want to sum all the positive values only for apples. (Note my rea
database has many more entries than this).

so I am sumif(database, "apples", quantity) which returns -1

what can I do to just get the positive numbers of apples ??

Help Please :
 
R

RagDyer

Enter the particular fruit that you're looking to count into C1, then try
this:
=SUMPRODUCT((A2:A100=C1)*(B2:B100>0)*B2:B100)
--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================
 
B

Biff

Hi!

Try this:

=SUMPRODUCT(--(A1:A4="apples"),--(B1:B4>0),B1:B4)

Or, use a cell to hold apples:

D1 = apples

=SUMPRODUCT(--(A1:A4=D1),--(B1:B4>0),B1:B4)

Biff
 
D

duane

=sumproduct((a1:a5="apples")*(b1:b5>=0)*(b1:b5))

sums items in b1:b5 >=0 where corresponding entry in column a is
"apples"
 

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