View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Return horizontal and vertical values

Try this...

With you data in the range A1:G4...

A10 = lookup_value = 19

Array formulas** :

For the topmost:

=INDEX(A1:G1,MAX((A1:G4=A10)*COLUMN(A1:G4)-MIN(COLUMN(A1:G4))+1))

For the leftmost:

=INDEX(A1:A4,MAX((A1:G4=A10)*ROW(A1:G4)-MIN(ROW(A1:G4))+1))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

Your table seems a little odd to me. Usually the top leftmost field is
empty. Based on your table, if you enter 1 in A10 both formulas will also
return 1.

--
Biff
Microsoft Excel MVP


"karl" wrote in message
...
Hi,

In one cell I need to return topmost corresponding horizontal value of a
table using a value from the table array.
In another cell, I need to return left most corresponding vertical value
in
a table using a value from the table array. example

1 2 3 4 5 6 7
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29

in one cell by typing 19, I want the formula to return 4 (matching from
topmost row), in another cell 16 (matching from leftmost column).

Thank you!
k