Syed Kamran Ahmed
Syed Kamran Ahmed

Reputation: 107

Find Column Name in Excel sheet if string matches

I have two sheets sheet1 and sheet2.There is a text in sheet1 'customer'.I want to find the column name like A from sheet2 if text 'customer' found in a cell of row 1 of sheet2.I am using Match function but it is returning only the index.Is there a way to find the column name like A? enter image description here

Upvotes: 1

Views: 3410

Answers (1)

Glitch_Doctor
Glitch_Doctor

Reputation: 3034

Took me a while of playing around but this will work for EXACT matches.

As the example data states Client and not Clients it returns an error and therefore is forced to state "Not Found". In cell B2 of sheet 1, copied down is the formula:

=IFERROR(SUBSTITUTE(ADDRESS(1,MATCH(A2,Sheet2!$A$1:$D$1,0),4),"1",""),"Not Found")

Example

Upvotes: 1

Related Questions