Solved

Function to return column heading number

Posted on 2012-03-14
9
184 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

617 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