Dynamic sum

opislak

Board Regular
Joined
Feb 28, 2017
Messages
68
Hello all,

I would like to make a Sum, based on a variable range of cells. Now I use an INDIRECT, but when I want to copy this formula to the cells on the right, the references stay the same, as they are considered as text.
Is there a possibility for automatically turning the Y into Z as I copy the formula from cell Y2 to cell Z2?
For your information: in cell $A$2 I store the number of lines of the used range. I fill cell A2 by means of a macro.

Excel Formula:
=SUM(INDIRECT("Y3:Y"&$A$2))

Many thanks!!
Patrick.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
It's easier if you don't use indirect.
Excel Formula:
=SUM(Y3:INDEX(Y:Y,$A$2))
 
Upvote 0
Solution

Forum statistics

Threads
1,215,590
Messages
6,125,702
Members
449,251
Latest member
Herushi

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