# Thread: Array match function Thanks: 0 Likes: 0

1. ## Array match function

I have the values a,b,c in cells A1 through to A3.

I have the value a in cell C1.

In cell C4, I type:

Code:
=MATCH(1,(C1=A1:A3))
and enter it as an array function.

I get the result of #N/A.

Why is that?

I thought the logic is as follows:

It compares the value in cell C1 (ie a) with the values in cells A1 to A3 and returns an array of TRUE, FALSE, FALSE.

These in turn are converted to 1,0,0.

Finally the result should be 1?

Thanks

2. ## Re: Array match function

You do create that array but you have nothing there that does any converting of the array to numbers and you need to use match type false or 0 as yours will default to true or 1. So maybe:

=MATCH(1,--(C1=A1:A3),0)

This needs CTRL-SHIFT-ENTER.

Or as you are doing an equals just use:

=MATCH(C1,A1:A3,0)

3. ## Re: Array match function

Originally Posted by steve the fish
You do create that array but you have nothing there that does any converting of the array to numbers and you need to use match type false or 0 as yours will default to true or 1. So maybe:

=MATCH(1,--(C1=A1:A3),0)

This needs CTRL-SHIFT-ENTER.

Or as you are doing an equals just use:

=MATCH(C1,A1:A3,0)

I don't understand the need for the -- because I am trying to follow this:

Code:
https://exceljet.net/formula/index-and-match-with-multiple-criteria

and that article doesn't add the --.

Besides, it doesn't explain the significance of the 1 immediately after the MATCH, ie:

Code:
MATCH(1,{0;0;1;0;0;0;0})
it states:

Code:
which is fed into the MATCH function as the lookup array, with a lookup value of 1:

4. ## Re: Array match function

You could just use =MATCH(TRUE, etc etc. Because you used =MATCH(1 then you need to convert a true/ false array into numbers. To do that you need to understand that to excel 0 = False and 1 = True. If you type :

=TRUE

into a cell, then type

=--TRUE

You may then see the significance of the -- when trying to match 1.

Thanks