Solved

Create a named structure reference

Posted on 2014-10-05
11
69 Views
Last Modified: 2014-10-05
Folks,
I've run into a problem where I would like to learn how to create a structure name to reference headers in a table:
 
To reference the headers =Source_Data[#Headers]

I'm can't seem to connect the dots.
0
Comment
Question by:Frank Freese
  • 6
  • 4
11 Comments
 
LVL 11

Assisted Solution

by:jkpieterse
jkpieterse earned 125 total points
ID: 40362320
I'm not sure in what context, in a formula, in VBA, ...?
Check out http://www.jkp-ads.com/articles/excel2007tablesvba.asp if it is VBA syntax you are looking for.
0
 

Author Comment

by:Frank Freese
ID: 40362323
I've been trying to edit the question as follows:

=INDEX(Source_Data[[#Headers],[Spend $]:[Cost / Sale]],,selection)

and I keep getting #NAME!
0
 
LVL 27

Assisted Solution

by:Glenn Ray
Glenn Ray earned 375 total points
ID: 40362344
Using a structrured reference on the table headers like:
=Source_Data[#Headers]
yields an array, so it's not a displayable value.

However, if you were using this in an indexing or array function - or wanted to create a dynamic range name, it's perfectly usable.  For example, the name of the third header lable in your table would be:
=INDEX(Source_Data[#Headers],1,3)

Regards,
-Glenn
0
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
LVL 27

Assisted Solution

by:Glenn Ray
Glenn Ray earned 375 total points
ID: 40362350
We cross-posted!  Looking at your follow-up, are you trying to do this in VBA?  "selection" makes me think so.

If so, are you trying to enter a formula in a cell with this reference or are you trying to determine the header lable based on the active cell's column on the sheet?

-Glenn
0
 

Author Comment

by:Frank Freese
ID: 40362351
One additional question please
[#Headers] is a predefined range and one does not have to define it in Name Manager?
0
 

Author Comment

by:Frank Freese
ID: 40362353
Actually, "selection" is a named range.
0
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 375 total points
ID: 40362358
[#Headers] alone is not a defined range, but used with the Excel Table identifier, it can be.  And it's dynamic; will change as the table layout changes.

if "selection" is a named range, the only issue would be if the value is greater than 2 (only two columns referenced) or less than 1.

-Glenn

Resources:

Resources (Microsoft)
Using structured references with Excel tables
Use structured references in Excel table formulas
0
 

Author Comment

by:Frank Freese
ID: 40362368
"selection" is a cell reference (I'm not having a very good Sunday)
Thanks I'm clearer now and appreciate everyone's help!
0
 

Author Closing Comment

by:Frank Freese
ID: 40362369
thank you kindly
0
 
LVL 27

Expert Comment

by:Glenn Ray
ID: 40362371
You're welcome.  The links I posted are very helpful (for me, at least).

-Glenn
0
 

Author Comment

by:Frank Freese
ID: 40362389
Those will be read!
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question