SOLVED

Dynamic Named Range Failure

Copper Contributor

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!?

 

8 Replies

@Trisa58 ,

 

In general it works

image.png

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.

@Sergei Baklan 

 

Could I upload 2 files and have you look at them?

@Trisa58 ,

 

Yes, sure. Only bit later, I'll have a break right now.

@Sergei Baklan 

I will upload, you take your time.  I really appreciate any and all help you can give.

best response confirmed by Trisa58 (Copper Contributor)
Solution

@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.

@Sergei Baklan 

 

Thank you, I will check these out.

 

Again, I greatly appreciate all your help.  I've worked with Excel for years, but never any formal training on formulas.

 

 

@Trisa58 , me too, never had any formal training.

 

Please inform if something doesn't work

@Sergei Baklan

 

PERFECT!!!!  Thank you! 

1 best response

Accepted Solutions
best response confirmed by Trisa58 (Copper Contributor)
Solution

@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.

View solution in original post