View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Zone[_3_] Zone[_3_] is offline
external usenet poster
 
Posts: 373
Default MATCH() on a 2D array?

Now, this should be doable in VBA with a 2D array of, say integers. Say I
want to know where the number 15 is located. Seems like the problem is it
would want to return 2 numbers corresponding to the 2 dimensions of the
array. Beyond me. Any interest in this? James

"Mike H" wrote in message
...
Hi,

Try this as an array so enter with Ctrl+Shift+Enter

=CELL("Address",INDEX(Table,MATCH(TRUE,COUNTIF(OFF SET(Table,ROW(Table)-CELL("Row",Table),0,1),D1)0,0),MATCH(D1,INDEX(Tab le,MATCH(TRUE,COUNTIF(OFFSET(Table,ROW(Table)-CELL("Row",Table),0,1),D1)0,0),0),0)))

Where
Table is the named range that holds you array
D1 is the value you are looking for.

There has to be a simpler way but i don't know it.

Mike

"Geoff Lambert" wrote:

In Excel2003 is it possible to use something MATCH() on a 2D array, to
find the position of a particular entry? The result could be expressed
as a 2-element vector of {row,column} or as a single number
representing the "cell number" (e.g. in a 3x3 array, the middle cell
would be #5

Geoff Lambert