Solved

Create a named structure reference

Posted on 2014-10-05
11
66 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
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…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

705 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now