Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
gmac
 
Posts: n/a
Default SUMIF positive values only from database


I want to sum all the positive values from a database for a single
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 real
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 :)


--
gmac
------------------------------------------------------------------------
gmac's Profile: http://www.excelforum.com/member.php...o&userid=23224
View this thread: http://www.excelforum.com/showthread...hreadid=383010

  #2   Report Post  
RagDyer
 
Posts: n/a
Default

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

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



"gmac" wrote in message
...

I want to sum all the positive values from a database for a single
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 real
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 :)


--
gmac
------------------------------------------------------------------------
gmac's Profile:

http://www.excelforum.com/member.php...o&userid=23224
View this thread: http://www.excelforum.com/showthread...hreadid=383010


  #3   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Try this:

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

Or, use a cell to hold apples:

D1 = apples

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

Biff

"gmac" wrote in message
...

I want to sum all the positive values from a database for a single
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 real
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 :)


--
gmac
------------------------------------------------------------------------
gmac's Profile:
http://www.excelforum.com/member.php...o&userid=23224
View this thread: http://www.excelforum.com/showthread...hreadid=383010



  #4   Report Post  
duane
 
Posts: n/a
Default


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

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


--
duane


------------------------------------------------------------------------
duane's Profile: http://www.excelforum.com/member.php...o&userid=11624
View this thread: http://www.excelforum.com/showthread...hreadid=383010

  #5   Report Post  
gmac
 
Posts: n/a
Default


Thanks guys, they both work. SUMPRODUCT and some brains go along way.

Thanks again.


--
gmac
------------------------------------------------------------------------
gmac's Profile: http://www.excelforum.com/member.php...o&userid=23224
View this thread: http://www.excelforum.com/showthread...hreadid=383010

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use SUMIF to return sums between two values located in cells ScottBerger Excel Worksheet Functions 2 April 23rd 23 09:05 PM
SUMIF function referring to values on different Worksheet TeeBee0831 Excel Worksheet Functions 10 May 3rd 05 10:28 PM
switching values from positive to negative lob Excel Worksheet Functions 5 February 18th 05 11:11 PM
How can I get Positive values only from the random number generat. Markw3700 Excel Discussion (Misc queries) 1 January 21st 05 12:37 AM
SUM(IF( Array to avoid #NUM! values Elijah Excel Worksheet Functions 7 November 21st 04 02:17 PM


All times are GMT +1. The time now is 09:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"