Solved

Create a named structure reference

Posted on 2014-10-05
11
71 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

730 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