How to access elements of a named range with Index or Offset w/o array spill

OaklandJim

Well-known Member
Joined
Nov 29, 2018
Messages
833
Office Version
  1. 365
Platform
  1. Windows
I did see some similar posts but nothing seemed to give me the answer. I apologize if this has been answered (numerous times)...

I named a horizontal one row range with 26 cells. I tried to use Index and offset to access a specific cell. Got the #SPILL result which, I've come to learn indicates that excel thinks I am accessing an entire array rather than one specific element (cell) of the named range.

'=IF(bInclude, OFFSET(Item1_Target,rcChart3ColIndex-1,0), 0)
'=IF(bInclude, Index(Item1_Target,rcChart3ColIndex), 0)

What simple concept am I missing?

Jim
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Of course. I was using an incorrect cell index with the Index function so indeed my screwed up input to the formula caused the grief. Index function now seems to work as expected.
 
Upvote 0
Solution
Hi Jim

You say you have a horizontal named range, but in the Offset() function you are using a vertical offset.
 
Upvote 0

Forum statistics

Threads
1,214,863
Messages
6,121,978
Members
449,058
Latest member
oculus

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