Named range works in one reference, fails in another

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
1,438
Office Version
  1. 365
Platform
  1. Windows
I am stumped. I have uploaded a workbook to this Dropbox folder:


I have defined several "dynamic" named ranges. For example, Column D contains the Biden votes for each state in the 2020 election. Row 7 has been assigned the name "Header" and row 64 has been assigned the name 'Footer". This allows me to define a named range (VotesBiden) as

VBA Code:
=OFFSET(@'Final Tallies'!Header,1,0):OFFSET(@'Final Tallies'!Footer,-1,0)

This works perfectly in D4 (=SUM(VotesBiden)) but fails in K8, L8, and E8.

What am I doing wrong?

I have used dynamic ranges like this many, many times and they always work.

Thanks
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,480
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
If you pass more than one cell as the anchor for OFFSET, it uses that entire range as the anchor. So your named range is actually returning all columns in between the header and footer rows, and your result is relying on implicit intersection - so it will work in column D since that intersects the columns of the result range - but is not part of that result range. K8, L8 and E8 are all part of the result range so you're creating circular references.
 

Some videos you may like

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
1,830
Office Version
  1. 365
Platform
  1. Windows
If you need me to break down the named range formula, no problem. It's quite easy to understand once you look at each component separately.
 

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
1,438
Office Version
  1. 365
Platform
  1. Windows
If you pass more than one cell as the anchor for OFFSET, it uses that entire range as the anchor. So your named range is actually returning all columns in between the header and footer rows, and your result is relying on implicit intersection - so it will work in column D since that intersects the columns of the result range - but is not part of that result range. K8, L8 and E8 are all part of the result range so you're creating circular references.
OK, thanks
 

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
1,438
Office Version
  1. 365
Platform
  1. Windows
If you need me to break down the named range formula, no problem. It's quite easy to understand once you look at each component separately.
That's OK. Even it I understand it today, I won't tomorrow. :confused: I understand my solution. It's a bit more work, but I understand it. At least as long as I can remember it correctly.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,791
Messages
5,626,898
Members
416,208
Latest member
tan21

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
Top