Say I have a table:
I want to search for a cell, and return its column header. For example, if I search for Orange
, the result is Fruit
. I can achieve this by using the nested if (E2
is Orange
in here):
=IF(NOT(ISERROR(MATCH(E2,A1:A4,0))),A1,IF(NOT(ISERROR(MATCH(E2,B1:B3,0))),B1,C1))
But in a large table this is impossible. Plus that I cannot know if error happens. Is there a better way to get the result? I don't know how many rows each column has. There is no duplicated data in the table. The table does not start in A1
, and can be moved to another spreadsheet in the future.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments