View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic
 
Posts: n/a
Default Using INDEX and MATCH to find data in 2 different sheets

In article ,
RMF wrote:

Excellent, many thanks!


You're very welcome! Glad I could help!

One question regarding this formula:

=INDEX($B$4:$D$6,MATCH(D$8,$A$4:$A$6,0),MATCH(1,($ B$1:$D$1=$A9)*($B$2:$D$2=$B9
)*($B$3:$D$3=$C9),0))

Why is the lookup value in the second MATCH formula 1? Dont understand this
one, perhaps I am missing something here


In the second MATCH function, you'll notice that there are three
conditional statements. Each statement returns an array of TRUE and/or
FALSE as each element in the array is evaluated...

($B$1:$D$1=$A9) evaluates to:

{TRUE,FALSE,FALSE}

($B$2:$D$2=$B9) evaluates to:

{TRUE,FALSE,FALSE}

($B$3:$D$3=$C9) evaluates to:

{TRUE,FALSE,FALSE}

These arrays are then multiplied together...

($B$1:$D$1=$A9)*($B$2:$D$2=$B9)*($B$3:$D$3=$C9) which evaluates to:

{TRUE,FALSE,FALSE}*{TRUE,FALSE,FALSE}*{TRUE,FALSE, FALSE} and gives us:

{1,0,0}

Notice that the numerical equivalent of TRUE/FALSE is 1/0, respectively.
Also, you'll notice that the statements evaluate to an array of 1's and
0's. With the lookup value for the MATCH function being 1, MATCH
returns 1,which is used as an argument for the INDEX function.

Hope this helps!