Dynamic sum

opislak

Board Regular
Joined
Feb 28, 2017
Messages
64
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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
13,992
Office Version
  1. 365
Platform
  1. Windows
It's easier if you don't use indirect.
Excel Formula:
=SUM(Y3:INDEX(Y:Y,$A$2))
 
Solution

Forum statistics

Threads
1,144,619
Messages
5,725,331
Members
422,617
Latest member
rahul27ragit

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
Top