Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 109
Default SUMPRODUCT Qusetion

What is the difference between these two formulas?
sumproduct((RangeA=CriteriaA)*(rangeB=CriteriaB)*( SumRange))
sumproduct(--(RangeA=CriteriaA),--(rangeB=CriteriaB),--(SumRange))

What exactly "--" represent?

Thanks


--
Helping Is always a good thing
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default SUMPRODUCT Qusetion

No difference.

Google for:
"double unary minus" Excel sumproduct
--
David Biddulph

"QuietMan" wrote in message
...
What is the difference between these two formulas?
sumproduct((RangeA=CriteriaA)*(rangeB=CriteriaB)*( SumRange))
sumproduct(--(RangeA=CriteriaA),--(rangeB=CriteriaB),--(SumRange))

What exactly "--" represent?

Thanks


--
Helping Is always a good thing



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default SUMPRODUCT Qusetion

See these:

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

http://mcgimpsey.com/excel/formulae/doubleneg.html

--
Biff
Microsoft Excel MVP


"QuietMan" wrote in message
...
What is the difference between these two formulas?
sumproduct((RangeA=CriteriaA)*(rangeB=CriteriaB)*( SumRange))
sumproduct(--(RangeA=CriteriaA),--(rangeB=CriteriaB),--(SumRange))

What exactly "--" represent?

Thanks


--
Helping Is always a good thing



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default SUMPRODUCT Qusetion

Yes there is. Just trying entering this data

A1:A10 (RangeA): Name,Bill,Bill,Bill,Joe,Joe,Joe,Mark,Jim,Jack
B1:B10 (RangeB): Year,2008,2009,2008,2007,2008,2009,2007,2007,2007
C1:C10 (SumRange): Amt,1,2,3,4,5,6,7,8,9

Run this formula,

=SUMPRODUCT(--(RangeA="Bill"),--(RangeB=2008),SumRange)

and you get 4 as you would expect. But try

=SUMPRODUCT((RangeA="Bill")*(RangeB=2008)*(SumRang e))

and see wat you get.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
No difference.

Google for:
"double unary minus" Excel sumproduct
--
David Biddulph

"QuietMan" wrote in message
...
What is the difference between these two formulas?
sumproduct((RangeA=CriteriaA)*(rangeB=CriteriaB)*( SumRange))
sumproduct(--(RangeA=CriteriaA),--(rangeB=CriteriaB),--(SumRange))

What exactly "--" represent?

Thanks


--
Helping Is always a good thing





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default SUMPRODUCT Qusetion

Yes there is. Just trying entering this data

A1:A10 (RangeA): Name,Bill,Bill,Bill,Joe,Joe,Joe,Mark,Jim,Jack
B1:B10 (RangeB): Year,2008,2009,2008,2007,2008,2009,2007,2007,2007
C1:C10 (SumRange): Amt,1,2,3,4,5,6,7,8,9

Run this formula,

=SUMPRODUCT(--(RangeA="Bill"),--(RangeB=2008),SumRange)

and you get 4 as you would expect. But try

=SUMPRODUCT((RangeA="Bill")*(RangeB=2008)*(SumRang e))

and see wat you get.


I get 4 for both formulas.

Rick


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default SUMPRODUCT Qusetion

OR, try entering this data:

RangeA
A2:A4 = Tom, Dick, Harry

RangeB
B1:D1 = 2006, 2007, 2008

Sum Range
B2:D4 = 1,2,3:4,5,6:7,8,9

And try this:
=SUMPRODUCT((A2:A4="Dick")*(B1:D1=2008)*B2:D4)
And you'll get 8.

But run:
=SUMPRODUCT(--(A2:A4="Dick"),--(B1:D1=2008),B2:D4)
And see what you'll get.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------


"Bob Phillips" wrote in message
...
Yes there is. Just trying entering this data

A1:A10 (RangeA): Name,Bill,Bill,Bill,Joe,Joe,Joe,Mark,Jim,Jack
B1:B10 (RangeB): Year,2008,2009,2008,2007,2008,2009,2007,2007,2007
C1:C10 (SumRange): Amt,1,2,3,4,5,6,7,8,9

Run this formula,

=SUMPRODUCT(--(RangeA="Bill"),--(RangeB=2008),SumRange)

and you get 4 as you would expect. But try

=SUMPRODUCT((RangeA="Bill")*(RangeB=2008)*(SumRang e))

and see wat you get.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
No difference.

Google for:
"double unary minus" Excel sumproduct
--
David Biddulph

"QuietMan" wrote in message
...
What is the difference between these two formulas?
sumproduct((RangeA=CriteriaA)*(rangeB=CriteriaB)*( SumRange))

sumproduct(--(RangeA=CriteriaA),--(rangeB=CriteriaB),--(SumRange))

What exactly "--" represent?

Thanks


--
Helping Is always a good thing







  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default SUMPRODUCT Qusetion

I don't think so Rick ... not if you put the TEXT value "Amt" in C1,
and included C1 in the Sum Range, C1 to C10.<g

That was the point Bob was making.

To make the asterisk form work, you'd have to revise the ranges to *exclude*
the header row:

=SUMPRODUCT((A2:A10="Bill")*(B2:B10=2008)*C2:C10)

My example goes in the other direction, where the unary doesn't work,
and the asterisk form does.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Rick Rothstein (MVP - VB)" wrote in
message ...
Yes there is. Just trying entering this data

A1:A10 (RangeA): Name,Bill,Bill,Bill,Joe,Joe,Joe,Mark,Jim,Jack
B1:B10 (RangeB): Year,2008,2009,2008,2007,2008,2009,2007,2007,2007
C1:C10 (SumRange): Amt,1,2,3,4,5,6,7,8,9

Run this formula,

=SUMPRODUCT(--(RangeA="Bill"),--(RangeB=2008),SumRange)

and you get 4 as you would expect. But try

=SUMPRODUCT((RangeA="Bill")*(RangeB=2008)*(SumRang e))

and see wat you get.


I get 4 for both formulas.

Rick



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default SUMPRODUCT Qusetion

Of course, that was not what I did :-(

Thanks for the "kick in the pants" on this.

Rick


"RagDyer" wrote in message
...
I don't think so Rick ... not if you put the TEXT value "Amt" in C1,
and included C1 in the Sum Range, C1 to C10.<g

That was the point Bob was making.

To make the asterisk form work, you'd have to revise the ranges to
*exclude* the header row:

=SUMPRODUCT((A2:A10="Bill")*(B2:B10=2008)*C2:C10)

My example goes in the other direction, where the unary doesn't work,
and the asterisk form does.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Rick Rothstein (MVP - VB)" wrote in
message ...
Yes there is. Just trying entering this data

A1:A10 (RangeA): Name,Bill,Bill,Bill,Joe,Joe,Joe,Mark,Jim,Jack
B1:B10 (RangeB): Year,2008,2009,2008,2007,2008,2009,2007,2007,2007
C1:C10 (SumRange): Amt,1,2,3,4,5,6,7,8,9

Run this formula,

=SUMPRODUCT(--(RangeA="Bill"),--(RangeB=2008),SumRange)

and you get 4 as you would expect. But try

=SUMPRODUCT((RangeA="Bill")*(RangeB=2008)*(SumRang e))

and see wat you get.


I get 4 for both formulas.

Rick




  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default SUMPRODUCT Qusetion

It's like the Chuckle Brothers <vbg

"RagDyer" wrote in message
...
OR, try entering this data:

RangeA
A2:A4 = Tom, Dick, Harry

RangeB
B1:D1 = 2006, 2007, 2008

Sum Range
B2:D4 = 1,2,3:4,5,6:7,8,9

And try this:
=SUMPRODUCT((A2:A4="Dick")*(B1:D1=2008)*B2:D4)
And you'll get 8.

But run:
=SUMPRODUCT(--(A2:A4="Dick"),--(B1:D1=2008),B2:D4)
And see what you'll get.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------


"Bob Phillips" wrote in message
...
Yes there is. Just trying entering this data

A1:A10 (RangeA): Name,Bill,Bill,Bill,Joe,Joe,Joe,Mark,Jim,Jack
B1:B10 (RangeB): Year,2008,2009,2008,2007,2008,2009,2007,2007,2007
C1:C10 (SumRange): Amt,1,2,3,4,5,6,7,8,9

Run this formula,

=SUMPRODUCT(--(RangeA="Bill"),--(RangeB=2008),SumRange)

and you get 4 as you would expect. But try

=SUMPRODUCT((RangeA="Bill")*(RangeB=2008)*(SumRang e))

and see wat you get.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
No difference.

Google for:
"double unary minus" Excel sumproduct
--
David Biddulph

"QuietMan" wrote in message
...
What is the difference between these two formulas?
sumproduct((RangeA=CriteriaA)*(rangeB=CriteriaB)*( SumRange))

sumproduct(--(RangeA=CriteriaA),--(rangeB=CriteriaB),--(SumRange))

What exactly "--" represent?

Thanks


--
Helping Is always a good thing








  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default SUMPRODUCT Qusetion

What are you doing up so late?

Is it a holiday in GB?<bg
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Bob Phillips" wrote in message
...
It's like the Chuckle Brothers <vbg

"RagDyer" wrote in message
...
OR, try entering this data:

RangeA
A2:A4 = Tom, Dick, Harry

RangeB
B1:D1 = 2006, 2007, 2008

Sum Range
B2:D4 = 1,2,3:4,5,6:7,8,9

And try this:
=SUMPRODUCT((A2:A4="Dick")*(B1:D1=2008)*B2:D4)
And you'll get 8.

But run:
=SUMPRODUCT(--(A2:A4="Dick"),--(B1:D1=2008),B2:D4)
And see what you'll get.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------


"Bob Phillips" wrote in message
...
Yes there is. Just trying entering this data

A1:A10 (RangeA): Name,Bill,Bill,Bill,Joe,Joe,Joe,Mark,Jim,Jack
B1:B10 (RangeB): Year,2008,2009,2008,2007,2008,2009,2007,2007,2007
C1:C10 (SumRange): Amt,1,2,3,4,5,6,7,8,9

Run this formula,

=SUMPRODUCT(--(RangeA="Bill"),--(RangeB=2008),SumRange)

and you get 4 as you would expect. But try

=SUMPRODUCT((RangeA="Bill")*(RangeB=2008)*(SumRang e))

and see wat you get.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
No difference.

Google for:
"double unary minus" Excel sumproduct
--
David Biddulph

"QuietMan" wrote in message
...
What is the difference between these two formulas?
sumproduct((RangeA=CriteriaA)*(rangeB=CriteriaB)*( SumRange))

sumproduct(--(RangeA=CriteriaA),--(rangeB=CriteriaB),--(SumRange))

What exactly "--" represent?

Thanks


--
Helping Is always a good thing












  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default SUMPRODUCT Qusetion

Missed your post (went to bed <g). I was working on an addin during the
evening, and my laptop just shutdown and I lost the lot, so I was redoing it
whilst it was all still in my head.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"RagDyer" wrote in message
...
What are you doing up so late?

Is it a holiday in GB?<bg
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Bob Phillips" wrote in message
...
It's like the Chuckle Brothers <vbg

"RagDyer" wrote in message
...
OR, try entering this data:

RangeA
A2:A4 = Tom, Dick, Harry

RangeB
B1:D1 = 2006, 2007, 2008

Sum Range
B2:D4 = 1,2,3:4,5,6:7,8,9

And try this:
=SUMPRODUCT((A2:A4="Dick")*(B1:D1=2008)*B2:D4)
And you'll get 8.

But run:
=SUMPRODUCT(--(A2:A4="Dick"),--(B1:D1=2008),B2:D4)
And see what you'll get.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit
!
---------------------------------------------------------------------------


"Bob Phillips" wrote in message
...
Yes there is. Just trying entering this data

A1:A10 (RangeA): Name,Bill,Bill,Bill,Joe,Joe,Joe,Mark,Jim,Jack
B1:B10 (RangeB): Year,2008,2009,2008,2007,2008,2009,2007,2007,2007
C1:C10 (SumRange): Amt,1,2,3,4,5,6,7,8,9

Run this formula,

=SUMPRODUCT(--(RangeA="Bill"),--(RangeB=2008),SumRange)

and you get 4 as you would expect. But try

=SUMPRODUCT((RangeA="Bill")*(RangeB=2008)*(SumRang e))

and see wat you get.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
No difference.

Google for:
"double unary minus" Excel sumproduct
--
David Biddulph

"QuietMan" wrote in message
...
What is the difference between these two formulas?
sumproduct((RangeA=CriteriaA)*(rangeB=CriteriaB)*( SumRange))

sumproduct(--(RangeA=CriteriaA),--(rangeB=CriteriaB),--(SumRange))

What exactly "--" represent?

Thanks


--
Helping Is always a good thing












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
sumproduct? sumif(sumproduct)? David Excel Worksheet Functions 3 July 13th 07 07:06 PM
Sumproduct Q Sean Excel Worksheet Functions 4 April 26th 07 08:34 PM
sumproduct? anand Excel Worksheet Functions 2 December 11th 05 09:12 AM
Sumproduct Jeremy Ellison Excel Worksheet Functions 1 December 9th 05 09:45 PM
SUMPRODUCT Hardy Excel Discussion (Misc queries) 1 November 24th 05 02:13 PM


All times are GMT +1. The time now is 04:51 PM.

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"