Using “INDIRECT” function in the “SUMPRODUCT” formula for True/False Cell Reference

前端 未结 2 1587
灰色年华
灰色年华 2021-01-29 00:42

This is the formula that I am currently using:

=SUMPRODUCT((INDIRECT(\"A2\"):INDIRECT(\"A\"&(ROW()-1))=A359)*1)

It works great, but I would

相关标签:
2条回答
  • 2021-01-29 01:14

    Try this one:

    =SUMPRODUCT((($A$2:INDEX($A:$A,ROW()-1))=INDEX($A:$A,ROW()))*1)
    

    it gives you the same result.

    But above formula is volatile. Instead I would use next one, say in B3 :

    =SUMPRODUCT((($A$2:$A2)=$A3)*1)
    
    0 讨论(0)
  • 2021-01-29 01:24

    I'm not sure why you need INDIRECT instead of ordinary cell references but the specific problem here is that ROW function returns an "array", even when it returns a single value, e.g. it returns {"x"} rather than just "x" - and in some circumstances Excel can't process that.

    Try wrapping the second ROW function in a SUM function - the value doesn't change but it gets rid of the array, i.e.

    =SUMPRODUCT((INDIRECT("A2"):INDIRECT("A"&(ROW()-1))=INDIRECT("A"&SUM(ROW())))*1)

    This will eliminate #VALUE! eror while leaving the essential structure of your formula unchanged

    0 讨论(0)
提交回复
热议问题