Thread: SUM help please
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.newusers
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default SUM help please

On Sat, 3 Mar 2012 19:32:46 -0800, "joeu2004" wrote:

"Ron Rosenfeld" wrote:
=SUMPRODUCT((MOD(ROW($A$1:$A$1000)-FirstRow,3)=0)*$A$1:$A$1000)


Actually, the above formula will only work if all of the entries
are numeric. If some of the entries are text, then the above
formula will give a VALUE error. To avoid that, you can use the
following formula:
This formula must be **array-entered**:
=SUM(IF(MOD(ROW($A$1:$A$1000)-FirstRow,3)=0, $A$1:$A$1000))


No need to abandon SUMPRODUCT and use the more complicated and error-prone
array-entered formula. Simply write:

=SUMPRODUCT(--(MOD(ROW($A$1:$A$1000)-FirstRow,3)=0),$A$1:$A$1000)

The double negative converts TRUE and FALSE to 1 and 0, which SUMPRODUCT
requires, as the multiplication did before.


Thank you for pointing that out. I was aware of the double unary behavior, but not of the behavior of SUMPRODUCT with the different factors as laid out in my previous message.