Use of Indirect function within SUM with multiple criteria

crackod93

Board Regular
Joined
Aug 9, 2007
Messages
71
Hi all,

Wondering if anyone has any ideas on the best way to use this INDIRECT function within this scenario...

Example Array Formula:

{=SUM((Data!$C$8:(INDIRECT("Data!$C"&maxrow))="Active")*(Data!$S$8:(INDIRECT("Data!$S"&maxrow))="Y")*(Data!$AS$8:(INDIRECT("Data!$AS"&maxrow))="G"))}

'maxrow' is a reference which counts the number of rows in use on the sheet (ie non-blank) = {=MAX(ROW(8:2999)*(A8:A2999<>""))}

Now the question that i have is that if a user inserts any columns into the 'Data' sheet, then only part of the formula is automatically updated with the new column reference, whereas the pieces which are within the INDIRECT brackets do not change, example:

{=SUM((Data!$D$8:(INDIRECT("Data!$C"&maxrow))="Active").....

The column letter in the INDIRECT part still shows as 'C', but the value should have updated to D (yes im aware that im fixing this position as the indirect part has the column letter in quotes)

So what im wondering is, how can i move this part out of the INDIRECT function whilst leaving the 'maxrow' part in - something like this:

{=SUM((Data!$C$8:$C(INDIRECT(""&maxrow))="Active")......

Ideas anyone???

thanks
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
You could use INDEX:

=SUM((Data!$C$8:INDEX(Data!$C:$C,maxrow)="Active")*(Data!$S$8:INDEX(Data!$S:$S,maxrow)="Y")*(Data!$AS$8:INDEX(Data!$AS:$AS,maxrow)="G"))
 
Upvote 0
hi, thank you for the very quick reply, just checked this quickly and it works a treat, hadnt even thought about using INDEX!!

thanks very much!!
 
Upvote 0
Also has the advantage of only being semi-volatile, unlike INDIRECT.
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,792
Members
452,942
Latest member
VijayNewtoExcel

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