Tell me more ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

In Google Spreadsheets I have a number of columns that I have given title to in Row 1.

Using a formula, I want to return the column number (i.e. 5, 6, 7, ...) for the column that has a specific title.

For example:
GetColumnNumber("Account Balance")

This GetColumnNumber() function above doesn't actually exist, but it demonstrates what I'm trying to do.

Is there a way to achieve the same result?

I've found this function reference which I've been trying to sift through:
http://docs.google.com/support/bin/answer.py?answer=82712&version=static

share|improve this question

migrated from superuser.com Feb 19 '11 at 1:03

2 Answers

up vote 2 down vote accepted

I think this will do what you want. For example if your columns are A to D,

=iferror(match("Account Balance",A1:D1,0),"No match")

returns the column number or an error message.

Thanks for pointing out that function list. It will come in handy.

share|improve this answer
Thanks - this is perfect. – Turgs Feb 19 '11 at 1:26

You were right on the money:

=COLUMN("Account Balance")

Returns the column number for the named range.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.