INDIRECT to range syntax

Arie Bos

Board Regular
Joined
Mar 25, 2016
Messages
224
Office Version
  1. 365
Platform
  1. Windows
I have monthly sheets, in which many formulas refer to one other sheet called 'Trades'. The data in sheet 'Trades' is over 40 columns and for this month between row 402 and 493. So, I refer to e.g. =AVERAGE(Trades'!E403:E493))

But, there are so many formula's like this, then for next month, where data are is from row 494 to row 587, I have to edit all these formulas to refer to the new data range.
So, I thought to put the starting row number and ending row number (so 402 and 493 for this month, and 494 and 587 for next month) in a fixed cell location on each monthly sheet. I though to use INDIRECT to insert the numbers in all these formulas, so I would just have update these two numbers once per month to have all formula's looking in the right data range.

But how to do this in a range, like (Trades'!E403:E493) ?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Say in A1 you enter: E403:E493 on the sheet where you want the average value to be returned. Then in the cell where you want that value returned enter:
=AVERAGE(INDIRECT("'Trades'!"&A1))
 
Upvote 0
Is there anything added in another column to indicate which month each cell is related to?

So say D403:D493 = "May" or whatever
But then D494:DD587 will = "June" ?

Then you can use AverageIf

Something like
=AVERAGEIF(Trades!D:D,"May",Trades!E:E)

Then you could even make it use whatever the current month is, or you write the month in a cell
=AVERAGEIF(Trades!D:D,A1,Trades!E:E)
And you put May in A1

Then when a new month begins, you only have to write the month in A1 for the formulas to auto update.
 
Last edited:
Upvote 0
Thank you JoeMo and JonMo1 :)

Both your solutions are great, and simple. Both solved my problem and allow me to make a much cleaner admin system in my excel.

Arie
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,855
Members
449,096
Latest member
Erald

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