#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default SumIf + And

I want to draw out information from a table of fields if two conditions are
true. SumIF doesn't seem to handle it, but I may be using it incorrectly.

A1=products, B1=price, C1=quantity sold, D1=quarter sold in

A2=carrots, $1.00, 20, 4
A3=beets, $2.00, 10, 4
A4=carrots, $1.00, 15, 3
A5=carrots, $1.00, 10, 4

So what I'm trying to get out of this is a sum of the Quantity of carrots
sold during each quarter. To me that's the Sum of quantities, If quarter = 1
and product = carrots - but I'm not sure how to build it...

Thoughts?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,358
Default SumIf + And

Easier way, use SUMPRODUCT.

=SUMPRODUCT(--($A$2:$A$5=vegetable),--($D$2:$D$5=quarter),($C$2:$C$5))
where vegetable is a reference to cell that shows what vegetable you are
searching for, and quarter is which quarter you are calculating. Obviously,
expand the ranges beyond row 5 as far as needed. Ensure all ranges are the
exact same length.
--
** John C **
Please remember, if your question is answered, to check the YES box below.
It helps everyone.


"Idolminder" wrote:

I want to draw out information from a table of fields if two conditions are
true. SumIF doesn't seem to handle it, but I may be using it incorrectly.

A1=products, B1=price, C1=quantity sold, D1=quarter sold in

A2=carrots, $1.00, 20, 4
A3=beets, $2.00, 10, 4
A4=carrots, $1.00, 15, 3
A5=carrots, $1.00, 10, 4

So what I'm trying to get out of this is a sum of the Quantity of carrots
sold during each quarter. To me that's the Sum of quantities, If quarter = 1
and product = carrots - but I'm not sure how to build it...

Thoughts?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default SumIf + And

=SUMPRODUCT((A2:A5="carrots")*(D2:D5=1)*(C2:C5)) if you want the quantity.
=SUMPRODUCT((A2:A5="carrots")*(D2:D5=1)*(C2:C5)*(B 2:B5)) if you wish to
multiply by the price too.
--
David Biddulph

"Idolminder" wrote in message
...
I want to draw out information from a table of fields if two conditions are
true. SumIF doesn't seem to handle it, but I may be using it incorrectly.

A1=products, B1=price, C1=quantity sold, D1=quarter sold in

A2=carrots, $1.00, 20, 4
A3=beets, $2.00, 10, 4
A4=carrots, $1.00, 15, 3
A5=carrots, $1.00, 10, 4

So what I'm trying to get out of this is a sum of the Quantity of carrots
sold during each quarter. To me that's the Sum of quantities, If quarter
= 1
and product = carrots - but I'm not sure how to build it...

Thoughts?



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
sumif for multi conditions. i.e sumif(A1:A10,"Jon" and B1:B10,"A" Harry Seymour Excel Worksheet Functions 9 June 12th 07 10:47 PM
SUMIF, Is this the only way Scott Excel Discussion (Misc queries) 1 May 3rd 07 04:46 PM
Embedding a Sumif in a sumif C.Pflugrath Excel Worksheet Functions 5 August 31st 05 07:31 PM
nested sumif or sumif with two criteria dshigley Excel Worksheet Functions 5 April 5th 05 03:34 AM
SUMIF - Range name to used for the "sum_range" portion of a SUMIF function Oscar Excel Worksheet Functions 2 January 11th 05 11:01 PM


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

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

About Us

"It's about Microsoft Excel"