View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JB99 JB99 is offline
external usenet poster
 
Posts: 3
Default Problem with using INDIRECT with SUMPRODUCT and ROW()

Thanks RagDyer,

Sorry if I wasn't clear:

Although
=SUM(INDIRECT("A" & ROW()-7 & ":A" & ROW()-6))
DOES work,

=SUMPRODUCT(INDIRECT("A" & ROW()-7 & ":A" & ROW()-6))
returns #VALUE!

Seems strange to me!


"RagDyer" wrote:

What exactly are you trying to do?

Since you say that you need to reference the current row,
AND
=SUM(INDIRECT("A" & ROW()-7 & ":A" & ROW()-6))
*DOES* work,

What *doesn't* work?
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"JB99" wrote in message
...
I'm encountering a strange issue, I was hoping that some experts here
might
be able to help.

If I enter the formula: =SUMPRODUCT(INDIRECT("A1:A2")), and put values in
A1
and A2, then this formula will correctly sum them (since there is no 2nd
array, SUMPRODUCT simply sums the values in the 1st arry.

However, if I enter the following formula into cell A8 (or any other cell,
this is just to make an example):

=SUMPRODUCT(INDIRECT("A" & ROW()-7 & ":A" & ROW()-6))

Then I get a #VALUE! error.

There seems to be something about using SUMPRODUCT, INDIRECT, and ROW all
together that causes this, because if I replace SUMPRODUCT with a simple
SUM,
i.e.:

=SUM(INDIRECT("A" & ROW()-7 & ":A" & ROW()-6))

Then I get an answer!

Or if I simply try:

=SUMPRODUCT(INDIRECT("A1:A2"))

However I'd like to be able to base this formula on the current row, so
need
to use all 3 together... Any ideas?????

Thanks.