Solved

Create a named structure reference

Posted on 2014-10-05
11
70 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
stuck in average-1 12 65
randomize data from excell cell 15 45
Frequency distribution of horizontal data? 5 29
Combine like values in a graph excel 2016 7 31
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

839 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