Results 1 to 5 of 5

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

  1. #1
    Board Regular
    Join Date
    Apr 2013
    Posts
    1,055
    Post Thanks / Like
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    Default 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. #2
    Board Regular steve the fish's Avatar
    Join Date
    Oct 2009
    Location
    Midlands, UK
    Posts
    7,648
    Post Thanks / Like
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)

    Default 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)
    Last edited by steve the fish; Aug 23rd, 2019 at 04:54 AM.
    Looking for opportunities

  3. #3
    Board Regular
    Join Date
    Apr 2013
    Posts
    1,055
    Post Thanks / Like
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Array match function

    Quote Originally Posted by steve the fish View Post
    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)
    Thanks for your reply.

    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:



    Last edited by tiredofit; Aug 23rd, 2019 at 04:59 AM.

  4. #4
    Board Regular steve the fish's Avatar
    Join Date
    Oct 2009
    Location
    Midlands, UK
    Posts
    7,648
    Post Thanks / Like
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)

    Default 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.
    Looking for opportunities

  5. #5
    Board Regular
    Join Date
    Apr 2013
    Posts
    1,055
    Post Thanks / Like
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Array match function

    Thanks

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •