Re: MATCH() on a 2D array?



Assumes there is a single instance of the lookup value.

Array entered:

=ADDRESS(MAX((table=D1)*ROW(table)),MAX((table=D1)*COLUMN(table)),4)

If there are multiple instances of the lookup value then you have to define
which instance you want based on direction. For example:

10...20...30
15...30...18
17...22...42

If the lookup value was 30 which one occurs first?

--
Biff
Microsoft Excel MVP


"Mike H" <MikeH@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8ACE33F2-391F-4CA2-80D5-FF893523CE0D@xxxxxxxxxxxxxxxx
Hi,

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

=CELL("Address",INDEX(Table,MATCH(TRUE,COUNTIF(OFFSET(Table,ROW(Table)-CELL("Row",Table),0,1),D1)>0,0),MATCH(D1,INDEX(Table,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




.



Relevant Pages

  • Re: The Kth element in a text list
    ... I have a bunch of formulae (e.g. LOOKUP, ... We use COUNTIF, < etc. because it is TEXT. ... =SMALL) for all numbers and no blanks. ... Or, an array formula: ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Need help with INDEX lookup
    ... type of data the lookup formula is returning and how complex the lookup ... And if you have to include sheet names then that makes it even longer! ... all of the lookup formulas are array formulas so they need to ... Microsoft Excel MVP ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Make Excel work faster
    ... Sub StartSW() ... Select Case MsgBox("Use VLookup?", _ ... "array lookup tester") ... It is practically impossible to get even near the speed of Excel's built-in (lookup) functions. ...
    (microsoft.public.excel.programming)
  • Re: VLookUP Problem with Time Comparision
    ... DaveM wrote: ... Thanks the array formula you provided removed all the #n/a returns. ... In an adjacent cells B1:B100 i have the following lookup formula.... ...
    (microsoft.public.excel.misc)
  • Re: Make Excel work faster
    ... if you need a lookup on a sheet use the VLookup worksheet function. ... If you have a VBA array though then looping is faster than using VLookup. ... If the values in the range are stable, reading them into VBA once and interrogate from there is good practice; I use that in my actuarial function system a lot. ...
    (microsoft.public.excel.programming)