return a column no

C

Craig McLaughlin

I have a cell containing text. I need a formula that takes the text and
finds an exact match in a row and return the column no.

Eg

Find Text: Name3


Name1 Name2 Name3 Name4 Name5


I want to return the column number which in this case is row 3.

I know there is a simple formula but I cant find it

Thanks
 
D

Dave Peterson

=match(a2,1:1,0)
will return the number of the column of the first match (if there is one).

Assumes that the Name3 is in A2 and the names are listed in A1:IV1 (row 1)
 
T

T. Valko

A1 = Name3

A5:E5 = Name1,Name2,Name3,Name4,Name5

This will return the *relative* position of the lookup_value in the
lookup_array:

=MATCH(A1,A5:E5,0)

=3
 
C

Craig McLaughlin

thanks to everyone for their help

Craig


Dave Peterson said:
=match(a2,1:1,0)
will return the number of the column of the first match (if there is one).

Assumes that the Name3 is in A2 and the names are listed in A1:IV1 (row 1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top