+ Reply to Thread
Results 1 to 7 of 7

Comparing list using INDEX MATCH etc. in an array-formula

  1. #1
    Forum Contributor
    Join Date
    10-31-2006
    Location
    Oslo, Norway
    MS-Off Ver
    MS 365 Business
    Posts
    286

    Comparing list using INDEX MATCH etc. in an array-formula

    The problem is that the formulas don't work if the tabel is in another position than at the
    top of the page.
    If I move, or construct, the tabel to the right, ie. starting at another column than A, it's
    OK, but if I move, or construct, the tabel in a lower row that 1, the formulas don't work.

    Please open the attachment which explains....

    Saturn
    Attached Files Attached Files
    Last edited by Saturn; 04-14-2013 at 08:16 AM.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Comparing list using INDEX MATCH etc. in an array-formula

    hi there. without changing too much, you probably can use:
    =INDEX(A:A,SMALL(IF(ISNA(MATCH($A$1:$A$12,$C$1:$C$9,0)),ROW($1:$12),""),ROWS(A$1:A2)))

    but my preference is usually not ranging up the whole columns & use offsetting of rows:
    =INDEX(A$2:A$12,SMALL(IF(ISNA(MATCH($A$2:$A$12,$C$2:$C$12,0)),ROW($A$2:$A$12)-ROW($A$2)+1),ROWS(E$2:E2)))

    and to get rid of the NUM error, you can always put an IFERROR in front of either the formulas:
    =IFERROR(Formula,"")

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Comparing list using INDEX MATCH etc. in an array-formula

    Hi Saturn

    The TRUE part of the IF is the: ROW($1:$13), which is returning a array: {1;2;3;4;5;6;7;8;9;10;11;12;13}
    If your data was elsewhere say A20:C30 (Headers in row 19) and you used ROW($20:$30), the array would be: {20;21;22;23;24;25;26;27;28;29;30} and you would get a error!
    So you need to change this to, ROW($20:$30)-ROW($19:$19) then the array would be: {1;2;3;4;5;6;7;8;9;10;11}
    Last edited by Kevin UK; 04-14-2013 at 06:39 AM.
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  4. #4
    Forum Contributor
    Join Date
    10-31-2006
    Location
    Oslo, Norway
    MS-Off Ver
    MS 365 Business
    Posts
    286

    Re: Comparing list using INDEX MATCH etc. in an array-formula

    Thanks to both benishiryo and Kevin UK

    To benishiryo:
    Your second proposal didn’t work as expected, you will see that in sheet 2, but the first one works well as shown in
    sheet3. Thanks a lot.

    I try to ‘transfer’ the formula to the column J: Names in B not in A, but you see the name ‘Judy’ is in the list which is wrong. Could you please look into the formula, starting in J8 in sheet 3 ?
    I would be very greatful.
    Attached Files Attached Files

  5. #5
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Comparing list using INDEX MATCH etc. in an array-formula

    Hi Saturn

    See the attached file.
    Attached Files Attached Files

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Comparing list using INDEX MATCH etc. in an array-formula

    Quote Originally Posted by Saturn View Post
    Your second proposal didn’t work as expected, you will see that in sheet 2, but the first one works well as shown in
    sheet3. Thanks a lot.
    I only see a sheet 1......

    I'd always use the second formula proposed by benishiryo because the syntax is robust enough to allow the ranges to change or rows to be inserted above, without the results changing - generically

    =INDEX(Data,SMALL(IF(ISNA(MATCH(Data,Search_List,0)),ROW(Data)-MIN(ROW(Data))+1),ROWS(X$2:X2)))

    confirmed with CTRL+SHIFT+ENTER

    where Data is the list to check and Search_List the list to check against...and X2 is the first cell where you place the formula
    Audere est facere

  7. #7
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Comparing list using INDEX MATCH etc. in an array-formula

    Hi Saturn

    Thanks for the feed back.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1