Solved

Function to return column heading number

Posted on 2012-03-14
9
183 Views
Last Modified: 2012-03-16
I would like to have a function that returns the number of the column in a table given I have provided the Header Name.  If this can be a inline function all the better.
0
Comment
Question by:StevenPMoffat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 37721730
Assuming that the headers are in row 1 you can use

=SUBSTITUTE(ADDRESS(1,MATCH("yourtitle",1:1,0),2),"$1","")

If it is some other row then change 1:1 to suit
0
 
LVL 42

Expert Comment

by:dlmille
ID: 37721935
You can use this array entered function (assuming your header is on row 1):

=MATCH(1,(1:1="Header_Name")*1,0)

type the function, then instead of hitting ENTER, Confirm with CTRL-SHIFT-ENTER

Dave
0
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 150 total points
ID: 37722041
Oops...column number...why not simply

=MATCH("Header_Name",1:1,0)
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 42

Expert Comment

by:dlmille
ID: 37722069
@ssaqibh - Good one.  While both are "correct" for finding the column header on the row, yours finds the last occurrence of that header, mine finds the first.  If there's only one, that last post is a winner!

Dave
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 37722090
Dave, are you back from your vacation? Probably not....both formulas give same results.
0
 
LVL 42

Expert Comment

by:dlmille
ID: 37722144
If there are multiple occurrences then they yield results as I posted

Yep. I'm back it was a quickie
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 37722157
Multiple occurences... both give same results.
0
 
LVL 42

Expert Comment

by:dlmille
ID: 37722180
Agree - I must have been looking cross-sighted :P
0
 

Author Closing Comment

by:StevenPMoffat
ID: 37729095
Very simple, thank you
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
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…

710 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