View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.newusers
Roger Govier[_3_] Roger Govier[_3_] is offline
external usenet poster
 
Posts: 2,480
Default Sumproduct Help! Thank You

Hi Peter

Whilst Sumproduct is a very clever formula, it is not as efficient as Sumif,
which only utilises the used range, no matter what range you give it.
Giving almost the whole column, G1:G65535 (you cannot use 65536), will give
you a big performance hit, as Sumproduct carries out it's work on lots of
empty cells.

You will be much better off by creating a Dynamic range for your data, which
will grow (or shrink) as you add more data.

InsertNameDefine
Name myData
Refers to =$G$1:INDEX($G:$G,COUNTA($G:$G))

=SUMPRODUCT(--(YEAR(myData)=$B$1),--(MONTH(myData)=D2)


--
Regards
Roger Govier

"Peter" wrote in message
...
"oldchippy" wrote in message
...

Peter;270369 Wrote:
Hi
Thanks for looking

Below is the formula i'm using and it works just fine.
=SUMPRODUCT(--(YEAR(Serial!$G$2:$G$3222)=$B$1),--(MONTH(Serial!$G$2:$G$3222)=D2)

What i'm trying to do is select the whole column (G) as below
=SUMPRODUCT(--(YEAR(Serial!G:G)=$B$1),--(MONTH(Serial!G:G)=D2)

I just can't get this to work, any ideas

Cheers
Peter (UK)

Hi,

Unless you have 2007 you can't specify the whole column with
SUMPRODUCT, but you can use G1:G65536


--
oldchippy
------------------------------------------------------------------------
oldchippy's Profile:
http://www.thecodecage.com/forumz/member.php?userid=111
View this thread:
http://www.thecodecage.com/forumz/sh...ad.php?t=75374


Cheers Guys for your replies

I don't fancy upgrading to 2007 just yet, i'll use the G1:G65536 work
around

Tanks again

Peter (UK)