View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kayce Kayce is offline
external usenet poster
 
Posts: 3
Default sums of range within sumproduct

It's a bit complicated. I have the following function:

=SUMPRODUCT((INDIRECT(B1)=1)*(INDIRECT($A$1)=2)*C1 )

I'd like to calculate a sum of the SUMPRODUCT(...) while varying B1 and C1
together (B1 references the name of a range, C1 references a number), and
then apply the same formula to a new cell that replaces the named range $A$1
without having to retype everything. For example:

=SUMPRODUCT((INDIRECT(B1)=1)*(INDIRECT(A1)=2)*C1)+ SUMPRODUCT((INDIRECT(B2)=1)*(INDIRECT(A1)=2)*C2)+S UMPRODUCT((INDIRECT(B3)=1)*(INDIRECT(A1)=2)*C3)+SU MPRODUCT((INDIRECT(B4)=1)*(INDIRECT(A1)=2)*C4)

And then that sum repeated for A1-A4. But without having to retype
everything.

I would appreciate any help you have. Thank you!