ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Lookup Value and Return Column Heading (https://www.excelbanter.com/excel-worksheet-functions/188725-lookup-value-return-column-heading.html)

EB

Lookup Value and Return Column Heading
 
Need formula to lookup a value from a table and return the corresponding
column heading.
For example, I would like to look up the value 12 and have the formula
return 2222.
Example of table - Table is 6 columns x 9 rows. No row headers just column
headers.

A B
1111 2222
1 06 07
2 09 10
3 11 12

Appreciate the help

Teethless mama

Lookup Value and Return Column Heading
 
=INDEX(A1:B1,MAX(INDEX((A2:B4=12)*COLUMN(A2:B4),)) )


"eb" wrote:

Need formula to lookup a value from a table and return the corresponding
column heading.
For example, I would like to look up the value 12 and have the formula
return 2222.
Example of table - Table is 6 columns x 9 rows. No row headers just column
headers.

A B
1111 2222
1 06 07
2 09 10
3 11 12

Appreciate the help


T. Valko

Lookup Value and Return Column Heading
 
Some of the values in the table data have leading 0s. Are these formatted
numbers or TEXT entries? Are there any duplicate values in the data table?

--
Biff
Microsoft Excel MVP


"eb" wrote in message
...
Need formula to lookup a value from a table and return the corresponding
column heading.
For example, I would like to look up the value 12 and have the formula
return 2222.
Example of table - Table is 6 columns x 9 rows. No row headers just column
headers.

A B
1111 2222
1 06 07
2 09 10
3 11 12

Appreciate the help




EB

Lookup Value and Return Column Heading
 
Thanks for the responses
No duplicates and all are formatted as numbers.

The first formula post will not return the value 100% of the time. The
lookup value will change and may or not be the max/min number in the column.

Thanks

"T. Valko" wrote:

Some of the values in the table data have leading 0s. Are these formatted
numbers or TEXT entries? Are there any duplicate values in the data table?

--
Biff
Microsoft Excel MVP


"eb" wrote in message
...
Need formula to lookup a value from a table and return the corresponding
column heading.
For example, I would like to look up the value 12 and have the formula
return 2222.
Example of table - Table is 6 columns x 9 rows. No row headers just column
headers.

A B
1111 2222
1 06 07
2 09 10
3 11 12

Appreciate the help





T. Valko

Lookup Value and Return Column Heading
 
The first formula post will not return the value 100% of the time.

What is the *exact* location of the table in cell references? Like: it's in
the range G10:L18.

--
Biff
Microsoft Excel MVP


"eb" wrote in message
...
Thanks for the responses
No duplicates and all are formatted as numbers.

The first formula post will not return the value 100% of the time. The
lookup value will change and may or not be the max/min number in the
column.

Thanks

"T. Valko" wrote:

Some of the values in the table data have leading 0s. Are these formatted
numbers or TEXT entries? Are there any duplicate values in the data
table?

--
Biff
Microsoft Excel MVP


"eb" wrote in message
...
Need formula to lookup a value from a table and return the
corresponding
column heading.
For example, I would like to look up the value 12 and have the formula
return 2222.
Example of table - Table is 6 columns x 9 rows. No row headers just
column
headers.

A B
1111 2222
1 06 07
2 09 10
3 11 12

Appreciate the help







EB

Lookup Value and Return Column Heading
 
Table Range A85:F94 -- Column headings in row 85

Thanks

"T. Valko" wrote:

The first formula post will not return the value 100% of the time.


What is the *exact* location of the table in cell references? Like: it's in
the range G10:L18.

--
Biff
Microsoft Excel MVP


"eb" wrote in message
...
Thanks for the responses
No duplicates and all are formatted as numbers.

The first formula post will not return the value 100% of the time. The
lookup value will change and may or not be the max/min number in the
column.

Thanks

"T. Valko" wrote:

Some of the values in the table data have leading 0s. Are these formatted
numbers or TEXT entries? Are there any duplicate values in the data
table?

--
Biff
Microsoft Excel MVP


"eb" wrote in message
...
Need formula to lookup a value from a table and return the
corresponding
column heading.
For example, I would like to look up the value 12 and have the formula
return 2222.
Example of table - Table is 6 columns x 9 rows. No row headers just
column
headers.

A B
1111 2222
1 06 07
2 09 10
3 11 12

Appreciate the help







EB

Lookup Value and Return Column Heading
 
Thanks all -- Was able to return the column heading with sumproduct.
=sumproduct((A85:F85)*(A86:F94="my lookup value"))

"eb" wrote:

Table Range A85:F94 -- Column headings in row 85

Thanks

"T. Valko" wrote:

The first formula post will not return the value 100% of the time.


What is the *exact* location of the table in cell references? Like: it's in
the range G10:L18.

--
Biff
Microsoft Excel MVP


"eb" wrote in message
...
Thanks for the responses
No duplicates and all are formatted as numbers.

The first formula post will not return the value 100% of the time. The
lookup value will change and may or not be the max/min number in the
column.

Thanks

"T. Valko" wrote:

Some of the values in the table data have leading 0s. Are these formatted
numbers or TEXT entries? Are there any duplicate values in the data
table?

--
Biff
Microsoft Excel MVP


"eb" wrote in message
...
Need formula to lookup a value from a table and return the
corresponding
column heading.
For example, I would like to look up the value 12 and have the formula
return 2222.
Example of table - Table is 6 columns x 9 rows. No row headers just
column
headers.

A B
1111 2222
1 06 07
2 09 10
3 11 12

Appreciate the help








All times are GMT +1. The time now is 10:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com