Thanks for your help.
I have, for example, counties in one row and under them I have cities and towns in those counties. So, really I have columns of info. You asked about rows. Does it have to be in rows or can I use columns instead?
"barry houdini" <barry.houdini[ at ]virgin.net> wrote in message news:63fe3cba-1778-477b-b217-2576b881608d[ at ]w1g2000prk.googlegroups.com...
[Quoted Text] > Hello Michael, > > Are you searching for the name in a single row or several rows? > > If it's the former then assuming you want to search in A2:J2 and > return the heder from A1:J1 try > > =INDEX(A$1:J$1,MATCH(L2,A2:J2,0)) > > where L2 contains the name for which you need to search > > for the latter try this to search within rows 2 to 10 > > =IF(COUNTIF(A2:J10,L2),INDEX(A$1:J$1,MIN(IF(A2:J10=L2,COLUMN(A2:J10)- > COLUMN(A2)+1))),"") > > This second formula is an "array formula" which needs to be confirmed > with CTRL+SHIFT+ENTER so that curly braces appear around the formula > in the formula bar
|