Function to return column heading number

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.
StevenPMoffatAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Saqib Husain, SyedConnect With a Mentor EngineerCommented:
Oops...column number...why not simply

=MATCH("Header_Name",1:1,0)
0
 
Saqib Husain, SyedEngineerCommented:
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
 
dlmilleCommented:
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
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
dlmilleCommented:
@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
 
Saqib Husain, SyedEngineerCommented:
Dave, are you back from your vacation? Probably not....both formulas give same results.
0
 
dlmilleCommented:
If there are multiple occurrences then they yield results as I posted

Yep. I'm back it was a quickie
0
 
Saqib Husain, SyedEngineerCommented:
Multiple occurences... both give same results.
0
 
dlmilleCommented:
Agree - I must have been looking cross-sighted :P
0
 
StevenPMoffatAuthor Commented:
Very simple, thank you
0
All Courses

From novice to tech pro — start learning today.