SUMIF positive values only from database

  • Thread starter Thread starter gmac
  • Start date Start date
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 :
 
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!
==============================================
 
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
 
=sumproduct((a1:a5="apples")*(b1:b5>=0)*(b1:b5))

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