Named range works in one reference, fails in another

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,491
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
 
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.
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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.
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

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