View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Peo Sjoblom
 
Posts: n/a
Default find first value in a row with value greater than 0

=MATCH(TRUE,A2:E20,0)


entered with ctrl + shift & enter will give you the column number counted
from A so in you example it would be 2 and then use index

=INDEX(A1:E1,MATCH(TRUE,A2:E20,0))



=LOOKUP(2,1/(1-(2:2="")),2:2)


this will return the last value in row 2 if by that we mean the right most
in row 2
--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com


"C-A" wrote in message
...
I need to search rows in a worksheet for the first cell with a value over 0
and return the corresponding column name to another worksheet. Then need
to
find the last cell with a value and return the corresponding column name.

eg.
worksheet 1
Celery Carrots Yams Onions Radish
0 3 7 5 0

worksheet 2
A B
Carrots Onions

Is it possible? I tried lookup and hlookup, but returning #N/A.

You assistance is appreciated.

Thanks