Forum Discussion

Peter Johansson's avatar
Peter Johansson
Copper Contributor
Nov 17, 2018
Solved

Finding the column name for a value in a table

I have a 3x3 table with a header and two data rows as below.

A1=First, B1=Second, C1=Third
A2=1, B2=2, C2=3
A3=4, B3=5, C3=6

In cell D1 I'd like to enter a search criteria. For example 5.
Then in E1 I'd like to output the name of the header for that column. In this case Second.

Following the logic this should be the result in E1 when entering each number in D1.

1 = First
2 = Second
3 = Third
4 = First
5= Second
6 = Third

I've tried Index, Match and Vlookup without success. How can you solve this? :)

12 Replies

Resources