drag formula?

lepend

Board Regular
Joined
May 23, 2009
Messages
82
Hi all,
Ive got the following formula and want to drag it but changing G:G in relation to the column
Code:
=SUMIFS(INDIRECT("'"&$F$4&"'!G:G"),INDIRECT("'"&$F$4&"'!C:C"),$E28,INDIRECT("'"&$F$4&"'!A:A"),$E$4)
Sorry, I didnt make this formula and really dont understand so well how this works so any explanations need to be for a complete newbie
Any help appreciated...
Thanks
lepend
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Try this

=SUMIFS(OFFSET(INDIRECT("'"&$F$4&"'!G:G"),0,COLUMNS($A:A)-1),INDIRECT("'"&$F$4&"'!C:C"),$E28,INDIRECT("'"&$F$4&"'!A:A"),$E$4)
 
Upvote 0
I took off the $ in $E28 and it drags down now.. but I need to drag horizontally and the G:G does not change according to the column
 
Upvote 0
That's the purpose of the offset.
You won't actually 'See' the G in the formula change to H I J etc as you drag it across.
But the offset will correctly increment which column is actually being referenced.
 
Last edited:
Upvote 0
OK its just I have quite a lot of columns to do manually and if I add a column in the middle of the sheet(s) then I need to manually change all columns on the right of what i add.. I thought there might be an easy way...
Also, is it a simple change to this formula if I want to restrict the amount of cells in that column to calculate.. its just that whenever I enter any data it takes a long time to calculate.. hope im making sense
 
Upvote 0
if I add a column in the middle of the sheet(s) then I need to manually change all columns on the right of what i add
Why would you have to do that?
After inserting a column, you could just re-drag the formula from a column 'to the left' of where you inserted


This is really just the nature of indirect, there's not much you can do about it.
 
Upvote 0
Ok no problem.. is there a way to make the calculations quicker... It just that for eg: G:G will be looking into 10s of thousands of cells every time I make a data entry
 
Last edited:
Upvote 0
You can just change your range references to specific row #s of your actual used area

instead of G:G, use G2:G1000

I understand the need to account for fluctuating range sizes, my rule of thumb (like for construction work) is 10% more than you need.
You must have some number in your mind that you can say, "Surely my data will never be more than xxx rows"
Use that number + 10%
Even if that number is 100,000, it's better than a million.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,263
Members
452,627
Latest member
KitkatToby

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