#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick
 
Posts: n/a
Default Reverse lookup

I need a better formula that will return a column header value if a cell in a
row contains a value greater than 0. I have over 1000 rows of data. Every
row where value0 needs to reference the text value in the corresponding
column header. I know I could replicate the same table using an if statement
for each cell formula, but I would like to return one column of values
instead of using multiple columns. Not sure if I am on the right track?

{=if($A2:$d2)0,then return value from range ($A$1:$D$1), "")}
C1 C2 C3 C4 Formula Result C5
R1 H P E J
R2 0 0 0 4 J
R3 8 0 0 0 H
R4 0 8 0 0 P

Need help!
Rick
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Reverse lookup

Hi!

Will there only be 1 non-zero value in each row? Will there be any rows will
all zeros?

This formula assumes there will be rows with all zeros and that there will
only be 1 non-zero value per row:

=IF(SUM(A2:D2),INDEX(A$1:D$1,MATCH(MAX(A2:D2),A2:D 2,0)),"")

Copy down as needed.

For rows with all zeros the result will be a blank cell.

Biff

"Rick" wrote in message
...
I need a better formula that will return a column header value if a cell in
a
row contains a value greater than 0. I have over 1000 rows of data. Every
row where value0 needs to reference the text value in the corresponding
column header. I know I could replicate the same table using an if
statement
for each cell formula, but I would like to return one column of values
instead of using multiple columns. Not sure if I am on the right track?

{=if($A2:$d2)0,then return value from range ($A$1:$D$1), "")}
C1 C2 C3 C4 Formula Result C5
R1 H P E J
R2 0 0 0 4 J
R3 8 0 0 0 H
R4 0 8 0 0 P

Need help!
Rick



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick
 
Posts: n/a
Default Reverse lookup

Biff,
Hello. Works great!
Yes, there will always be one value in each row or all zeros. In looking
through my data set everything seems to work fine.

Much appreciated!
Rick
--
Need help!
Rick


"Biff" wrote:

Hi!

Will there only be 1 non-zero value in each row? Will there be any rows will
all zeros?

This formula assumes there will be rows with all zeros and that there will
only be 1 non-zero value per row:

=IF(SUM(A2:D2),INDEX(A$1:D$1,MATCH(MAX(A2:D2),A2:D 2,0)),"")

Copy down as needed.

For rows with all zeros the result will be a blank cell.

Biff

"Rick" wrote in message
...
I need a better formula that will return a column header value if a cell in
a
row contains a value greater than 0. I have over 1000 rows of data. Every
row where value0 needs to reference the text value in the corresponding
column header. I know I could replicate the same table using an if
statement
for each cell formula, but I would like to return one column of values
instead of using multiple columns. Not sure if I am on the right track?

{=if($A2:$d2)0,then return value from range ($A$1:$D$1), "")}
C1 C2 C3 C4 Formula Result C5
R1 H P E J
R2 0 0 0 4 J
R3 8 0 0 0 H
R4 0 8 0 0 P

Need help!
Rick




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Reverse lookup

You're welcome. Thanks for the feedback!

Biff

"Rick" wrote in message
...
Biff,
Hello. Works great!
Yes, there will always be one value in each row or all zeros. In looking
through my data set everything seems to work fine.

Much appreciated!
Rick
--
Need help!
Rick


"Biff" wrote:

Hi!

Will there only be 1 non-zero value in each row? Will there be any rows
will
all zeros?

This formula assumes there will be rows with all zeros and that there
will
only be 1 non-zero value per row:

=IF(SUM(A2:D2),INDEX(A$1:D$1,MATCH(MAX(A2:D2),A2:D 2,0)),"")

Copy down as needed.

For rows with all zeros the result will be a blank cell.

Biff

"Rick" wrote in message
...
I need a better formula that will return a column header value if a cell
in
a
row contains a value greater than 0. I have over 1000 rows of data.
Every
row where value0 needs to reference the text value in the
corresponding
column header. I know I could replicate the same table using an if
statement
for each cell formula, but I would like to return one column of values
instead of using multiple columns. Not sure if I am on the right
track?

{=if($A2:$d2)0,then return value from range ($A$1:$D$1), "")}
C1 C2 C3 C4 Formula Result C5
R1 H P E J
R2 0 0 0 4 J
R3 8 0 0 0 H
R4 0 8 0 0 P

Need help!
Rick






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
reverse mapping for LOOKUP table? Kok Yong Lee Excel Worksheet Functions 6 March 29th 06 01:57 PM
Need help with reverse phone lookup steve2003 Excel Worksheet Functions 2 June 21st 05 09:01 PM
Lookup Vector > Lookup Value Alec Kolundzic Excel Worksheet Functions 6 June 10th 05 02:14 PM
Lookup function w/Text and Year Josh O. Excel Worksheet Functions 1 February 12th 05 11:27 PM
double lookup, nest, or macro? Josef.angel Excel Worksheet Functions 1 October 29th 04 09:50 AM


All times are GMT +1. The time now is 02:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"