dynamic cell reference

rnl0085

Board Regular
Joined
Dec 3, 2010
Messages
69
i'm trying to get a function to work that uses a dynamic cell reference:

sumproduct($A$1:$A$20,$B$1:$B$20)
where the 1 (in cell C1) and 20 (in cell C2) i have dynamic:
sumproduct(indirect("$A$"&C1&":$A$"&C2&",$B$"&C1&":$B$"&C2)
this doesn't work however..even trying only with a single argument in the sum function within the indirect doesn't work (then it tries to take the sum of just to single cells (a1 and a20, sum(x:x) with x the values of a1 and a20 instead of sum(a1:a20)
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
i'm trying to get a function to work that uses a dynamic cell reference:

sumproduct($A$1:$A$20,$B$1:$B$20)
where the 1 (in cell C1) and 20 (in cell C2) i have dynamic:
sumproduct(indirect("$A$"&C1&":$A$"&C2&",$B$"&C1&":$B$"&C2)
this doesn't work however..even trying only with a single argument in the sum function within the indirect doesn't work (then it tries to take the sum of just to single cells (a1 and a20, sum(x:x) with x the values of a1 and a20 instead of sum(a1:a20)

Try...

=SUMPRODUCT(OFFSET(INDEX(A:A,$C$1),0,0,$C$2),OFFSET(INDEX(B:B,$C$1),0,0,$C$2))
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,673
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top