Generic SUMIF formula using INDIRECT

QB

Board Regular
Joined
Jul 5, 2004
Messages
93
Hi

I have a SUMIF formula to summarise my accounting data. The formula I use is =SUMIF('SageData'!$DV$12:$DV$233,$A20,'SageData'!$ED$12:$ED$233). I want to make the formula generic by picking up the criteria and sum_range ranges from cells in the top row of the worksheet. I created two dynamic ranges rRollUp and rPerAct for the criteria and sum_range ranges and changed the formula to: =SUMIF(rRollUp,$A20,rPerAct). This returned the correct result. I now want to store the criteria range name rRollUp in cell A1 and the sum_range range name in cell G1 and change the SUMIF formula to pickup these two range names from the appropriate cells. The formula I thought was correct is =SUMIF(INDIRECT(A1),$A20,INDIRECT(G1)) which returns a #REF! error.

I hope someone can point out the error of my ways!

Many thanks in advance.

QB
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,224,502
Messages
6,179,126
Members
452,890
Latest member
Nikhil Ramesh

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