Problem definition:
Enter any number in cell A1
. Now try the following formulae anywhere on first row.
=SUM(INDIRECT("A"&ROW()))
and
=SUMPRODUCT(INDIRECT("A"&ROW()))
The first formula evaluates, the second one gives a #VALUE error.
This is caused by the ROW()
function behaving differently inside SUMPRODUCT()
.
In the first formula, ROW()
returns 1
. In the second formula, row returns {1}
(array of one length), even though the formula has not been entered as a CSE formula.
Why does this happen?
Background
I need to evaluate a formula of the type
=SUMPRODUCT(INDIRECT(*range formed by concatenation and using ROW()*)>1)
This is working out to an error. As a workaround to this issue, I now calculate ROW()
in another cell (in the same row, obviously) and concatenate that inside my INDIRECT()
. Alternately, I also have tried encapsulating it inside a sum function, like SUM(ROW())
, and that works as well.
I would sure appreciate it if someone could explain (or point me to a resource that can explain) why ROW()
returns an array inside SUMPRODUCT()
without being CSE entered.