Forum Discussion

Trisa58's avatar
Trisa58
Copper Contributor
Apr 27, 2019
Solved

Dynamic Named Range Failure

I've created a workbook that will be used as a checkbook, made up of a tab for each month.  There are also categories for register entry.  There is also a summary tab that will pull info from each sheet into an income/expense statement.  That was built with a named range that included the tab names (Jan thru Feb), and the following formula:

 

=SUMPRODUCT(SUMIF(INDIRECT("'"&Months&"'!d9:d101"),$D22,INDIRECT("'"&Months&"'!f9:f101")))

 

This formula works AWESOME, however, because the tabs are pre-populated with regular monthly expenditures, I wanted to find a way to automatically update the named range as each month passed.  that led me to a formula to create a Dynamic Named Range using this formula:

 

=OFFSET(SUMMARY!$A7,1,0,COUNTA(SUMMARY!$A:$A)-1,1)

 

This is where I get a #REF! error.

 

HELP!?

 

  • Trisa58 , no problem.

     

    In test file in the formula you started range from A8, actually it's from A1. In main file you have the cell with empty string below your months, thus COUNTA returned incorrect result. Since we have only twelve months in the year I'd recommend to limit the range accordingly, not use A:A. Finally the formula is

    =OFFSET(SUMMARY!$A$2,0,0,COUNTA(SUMMARY!$A$1:$A$13)-1,1)

    I corrected in both files. Please be carefull with relative and absolute references, here all are to be absolute.

8 Replies

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    Trisa58 ,

     

    In general it works

    Most probably you need to change second parameter in OFFSET on zero and don't deduct 1 from COUNTA. Last parameter is not required here.

Resources