PC Review


Reply
Thread Tools Rate Thread

Combine SUMIF and SUMPRODUCT

 
 
=?Utf-8?B?VGV2dW5h?=
Guest
Posts: n/a
 
      21st Jun 2007
Here is how the data is setup:

A B C
Type Qt. Rate
Category1 5 $10.00
Category2 6 $2.00
Category1 .5 $.50
Category2 10 $7.00

Here is the objective:

Calculate total amount, by mulitplying Qt. and Rate, if Category = category1
SUMPRODUCT doesn't take an argument for condition, and SUMIF can't multiply.
Is there a formula that combines them both?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      21st Jun 2007
Why not do your multiplication on the worksheet in d1 and then use:-

=SUMPRODUCT(--(A1:A4="Category 1"),(D14))

Mike

"Tevuna" wrote:

> Here is how the data is setup:
>
> A B C
> Type Qt. Rate
> Category1 5 $10.00
> Category2 6 $2.00
> Category1 .5 $.50
> Category2 10 $7.00
>
> Here is the objective:
>
> Calculate total amount, by mulitplying Qt. and Rate, if Category = category1
> SUMPRODUCT doesn't take an argument for condition, and SUMIF can't multiply.
> Is there a formula that combines them both?

 
Reply With Quote
 
PCLIVE
Guest
Posts: n/a
 
      21st Jun 2007
See if this does what you want.

=SUMPRODUCT(--(A2:A5="Category1"),B2:B5*C2:C5)

HTH,
Paul



"Tevuna" <(E-Mail Removed)> wrote in message
news:147FCF9A-5CF7-4942-B902-(E-Mail Removed)...
> Here is how the data is setup:
>
> A B C
> Type Qt. Rate
> Category1 5 $10.00
> Category2 6 $2.00
> Category1 .5 $.50
> Category2 10 $7.00
>
> Here is the objective:
>
> Calculate total amount, by mulitplying Qt. and Rate, if Category =
> category1
> SUMPRODUCT doesn't take an argument for condition, and SUMIF can't
> multiply.
> Is there a formula that combines them both?



 
Reply With Quote
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      21st Jun 2007
Or if you want the multiplication at formula level try:-

=SUMPRODUCT(--(A1:A4="Category 1"),(B1:B4)*(C1:C4))

Mike

"Tevuna" wrote:

> Here is how the data is setup:
>
> A B C
> Type Qt. Rate
> Category1 5 $10.00
> Category2 6 $2.00
> Category1 .5 $.50
> Category2 10 $7.00
>
> Here is the objective:
>
> Calculate total amount, by mulitplying Qt. and Rate, if Category = category1
> SUMPRODUCT doesn't take an argument for condition, and SUMIF can't multiply.
> Is there a formula that combines them both?

 
Reply With Quote
 
=?Utf-8?B?VG9wcGVycw==?=
Guest
Posts: n/a
 
      21st Jun 2007
=SUMPRODUCT(($A$2:$A$5="Category1")*($B$2:$B$5*$C$2:$C$5))

"Tevuna" wrote:

> Here is how the data is setup:
>
> A B C
> Type Qt. Rate
> Category1 5 $10.00
> Category2 6 $2.00
> Category1 .5 $.50
> Category2 10 $7.00
>
> Here is the objective:
>
> Calculate total amount, by mulitplying Qt. and Rate, if Category = category1
> SUMPRODUCT doesn't take an argument for condition, and SUMIF can't multiply.
> Is there a formula that combines them both?

 
Reply With Quote
 
=?Utf-8?B?VGV2dW5h?=
Guest
Posts: n/a
 
      21st Jun 2007
1) My question is if Excel provides a way to do it all in a single cell.
2) When creating a new porduct column, column D, the SUMIF rather then
SUMPRODUCT should be used. I'm I missing something here?
3) What are the double negative signs (--) that you and many other folks
here are using?

"Mike H" wrote:

> Why not do your multiplication on the worksheet in d1 and then use:-
>
> =SUMPRODUCT(--(A1:A4="Category 1"),(D14))
>
> Mike
>
> "Tevuna" wrote:
>
> > Here is how the data is setup:
> >
> > A B C
> > Type Qt. Rate
> > Category1 5 $10.00
> > Category2 6 $2.00
> > Category1 .5 $.50
> > Category2 10 $7.00
> >
> > Here is the objective:
> >
> > Calculate total amount, by mulitplying Qt. and Rate, if Category = category1
> > SUMPRODUCT doesn't take an argument for condition, and SUMIF can't multiply.
> > Is there a formula that combines them both?

 
Reply With Quote
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      21st Jun 2007
The -- coerces Excel into treating text as a number

Mike

"Tevuna" wrote:

> 1) My question is if Excel provides a way to do it all in a single cell.
> 2) When creating a new porduct column, column D, the SUMIF rather then
> SUMPRODUCT should be used. I'm I missing something here?
> 3) What are the double negative signs (--) that you and many other folks
> here are using?
>
> "Mike H" wrote:
>
> > Why not do your multiplication on the worksheet in d1 and then use:-
> >
> > =SUMPRODUCT(--(A1:A4="Category 1"),(D14))
> >
> > Mike
> >
> > "Tevuna" wrote:
> >
> > > Here is how the data is setup:
> > >
> > > A B C
> > > Type Qt. Rate
> > > Category1 5 $10.00
> > > Category2 6 $2.00
> > > Category1 .5 $.50
> > > Category2 10 $7.00
> > >
> > > Here is the objective:
> > >
> > > Calculate total amount, by mulitplying Qt. and Rate, if Category = category1
> > > SUMPRODUCT doesn't take an argument for condition, and SUMIF can't multiply.
> > > Is there a formula that combines them both?

 
Reply With Quote
 
=?Utf-8?B?VGV2dW5h?=
Guest
Posts: n/a
 
      21st Jun 2007
Toppers,
Your formula works, I can't understand the syntax, though.
1) SUMPRODUCT multiplies corresponding rows in multiple arrays. If only one
array is given, SUMPRODUCT multiplies all the rows within that column. If it
has no comma, it is only one array.
2) ($A$2:$A$5="Category1") is logical, True or False, so when
*($B$2:$B$5*$C$2:$C$5)
What is being multiplied?




"Toppers" wrote:

> =SUMPRODUCT(($A$2:$A$5="Category1")*($B$2:$B$5*$C$2:$C$5))
>
> "Tevuna" wrote:
>
> > Here is how the data is setup:
> >
> > A B C
> > Type Qt. Rate
> > Category1 5 $10.00
> > Category2 6 $2.00
> > Category1 .5 $.50
> > Category2 10 $7.00
> >
> > Here is the objective:
> >
> > Calculate total amount, by mulitplying Qt. and Rate, if Category = category1
> > SUMPRODUCT doesn't take an argument for condition, and SUMIF can't multiply.
> > Is there a formula that combines them both?

 
Reply With Quote
 
=?Utf-8?B?VG9wcGVycw==?=
Guest
Posts: n/a
 
      21st Jun 2007
SUMPRODUCT builds a multi-dimensional array:

So for your example a2=TRUE,a3=FALSE,a4=TRUE and a5=FALSE. These are
converted to 1 (TRUE) and 0 (FALSE) either by preceding with -- OR *
(Multiplication)

It then multiples a2*b2*c2, a3*b3*c3 etc: the FALSE value (0) will give a
result of 0 and the TRUE values will give 1*b2*c2 (for example).These are
SUMmed to give the result.

See here for a full explanation of SUMPRODUCT:

http://www.xldynamic.com/source/xld.SUMPRODUCT.html

HTH

"Tevuna" wrote:

> Toppers,
> Your formula works, I can't understand the syntax, though.
> 1) SUMPRODUCT multiplies corresponding rows in multiple arrays. If only one
> array is given, SUMPRODUCT multiplies all the rows within that column. If it
> has no comma, it is only one array.
> 2) ($A$2:$A$5="Category1") is logical, True or False, so when
> *($B$2:$B$5*$C$2:$C$5)
> What is being multiplied?
>
>
>
>
> "Toppers" wrote:
>
> > =SUMPRODUCT(($A$2:$A$5="Category1")*($B$2:$B$5*$C$2:$C$5))
> >
> > "Tevuna" wrote:
> >
> > > Here is how the data is setup:
> > >
> > > A B C
> > > Type Qt. Rate
> > > Category1 5 $10.00
> > > Category2 6 $2.00
> > > Category1 .5 $.50
> > > Category2 10 $7.00
> > >
> > > Here is the objective:
> > >
> > > Calculate total amount, by mulitplying Qt. and Rate, if Category = category1
> > > SUMPRODUCT doesn't take an argument for condition, and SUMIF can't multiply.
> > > Is there a formula that combines them both?

 
Reply With Quote
 
=?Utf-8?B?VGV2dW5h?=
Guest
Posts: n/a
 
      21st Jun 2007
I Thank you so much, you realy are at the top of the toppers

"Toppers" wrote:

> SUMPRODUCT builds a multi-dimensional array:
>
> So for your example a2=TRUE,a3=FALSE,a4=TRUE and a5=FALSE. These are
> converted to 1 (TRUE) and 0 (FALSE) either by preceding with -- OR *
> (Multiplication)
>
> It then multiples a2*b2*c2, a3*b3*c3 etc: the FALSE value (0) will give a
> result of 0 and the TRUE values will give 1*b2*c2 (for example).These are
> SUMmed to give the result.
>
> See here for a full explanation of SUMPRODUCT:
>
> http://www.xldynamic.com/source/xld.SUMPRODUCT.html
>
> HTH
>
> "Tevuna" wrote:
>
> > Toppers,
> > Your formula works, I can't understand the syntax, though.
> > 1) SUMPRODUCT multiplies corresponding rows in multiple arrays. If only one
> > array is given, SUMPRODUCT multiplies all the rows within that column. If it
> > has no comma, it is only one array.
> > 2) ($A$2:$A$5="Category1") is logical, True or False, so when
> > *($B$2:$B$5*$C$2:$C$5)
> > What is being multiplied?
> >
> >
> >
> >
> > "Toppers" wrote:
> >
> > > =SUMPRODUCT(($A$2:$A$5="Category1")*($B$2:$B$5*$C$2:$C$5))
> > >
> > > "Tevuna" wrote:
> > >
> > > > Here is how the data is setup:
> > > >
> > > > A B C
> > > > Type Qt. Rate
> > > > Category1 5 $10.00
> > > > Category2 6 $2.00
> > > > Category1 .5 $.50
> > > > Category2 10 $7.00
> > > >
> > > > Here is the objective:
> > > >
> > > > Calculate total amount, by mulitplying Qt. and Rate, if Category = category1
> > > > SUMPRODUCT doesn't take an argument for condition, and SUMIF can't multiply.
> > > > Is there a formula that combines them both?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combine Sumif and Countif John Microsoft Excel Worksheet Functions 3 4th Feb 2010 03:42 PM
Combine Sumif and Subtotal Flu Microsoft Excel Misc 4 18th Jul 2008 04:04 AM
Combine Sumif moglione1 Microsoft Excel Misc 1 18th Jul 2006 01:46 PM
Combine Indirect and Sumif dcd123 Microsoft Excel Worksheet Functions 3 27th Oct 2005 04:20 PM
SUMPRODUCT - How to combine =?Utf-8?B?Um9iZXJ0?= Microsoft Excel Worksheet Functions 4 1st Feb 2005 01:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:30 PM.