+ Reply to Thread
Results 1 to 8 of 8

INDEX/MATCH array function returning nothing for some queries but not others

  1. #1
    Registered User
    Join Date
    12-12-2016
    Location
    London, England
    MS-Off Ver
    2013 Professional
    Posts
    28

    INDEX/MATCH array function returning nothing for some queries but not others

    Hi everyone,

    I've been having difficulty with a sheet I've been putting together. Essentially, it is a list of people and their responsibilities VLOOK-ed-UP from another spreadsheet, which in turn is indexed with a multiple result array formula, shown below:

    {=IF(ISERROR(INDEX($AA$1:$AC$345,SMALL(IF($AC$1:$AC$345="U",ROW($AC$1:$AC$345)),ROW(1:1)),1)),"",INDEX($AA$1:$AC$345,SMALL(IF($AC$1:$AC$345="U",ROW($AC$1:$AC$345)),ROW(1:1)),1))}

    With "U" being the name of the person for whom the results are being returned. This is copied multiple times across the table for different people and ranges, and works just fine, but in two columns, for the same person, the formulas go blank, like there's nothing in the table. I've tried formatting the whole table, all kinds of permutations of testing, but I just can't work out why the same formula, searching the same set of data generated in the same way, would return a negative result.

    Any help or suggestions enormously appreciated,

    JB
    Last edited by AJB611; 12-12-2016 at 12:02 PM. Reason: Solved

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,239

    Re: INDEX/MATCH array function returning nothing for some queries but not others

    Welcome to the forums!

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    12-12-2016
    Location
    London, England
    MS-Off Ver
    2013 Professional
    Posts
    28

    Re: INDEX/MATCH array function returning nothing for some queries but not others

    EDIT: In the process of building the sample sheet, I have encountered the same problem with a VLOOKUP function, which must have the same cause. This occurs at row Z of sheet 1. As you can see, some values in AC do not populate whilst others do.
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,239

    Re: INDEX/MATCH array function returning nothing for some queries but not others

    It's a trailing space problem - look at the cell containing Alpha on Sheet3 - put your cursor in the cell and you'll see there's a trailing space - that's why there is no match.

  5. #5
    Valued Forum Contributor
    Join Date
    08-04-2011
    Location
    UK
    MS-Off Ver
    Excel 2021
    Posts
    346

    Re: INDEX/MATCH array function returning nothing for some queries but not others

    the data in sheet 3 column A has extra space at the end.

    try to use trim() to clean them

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,877

    Re: INDEX/MATCH array function returning nothing for some queries but not others

    You have trailing space in some cells in Sheet3 & 2.

    You can either modify your formula to something like....
    =IFERROR(VLOOKUP(TRIM(AA1),TRIM(Sheet3!$A$1:$B$100),2, FALSE),"")

    Confirmed as array (CTRL + SHIFT + ENTER).

    Or perform text to column, use text function etc in Sheet3 to clean up strings (same goes for Sheet2).

  7. #7
    Registered User
    Join Date
    12-12-2016
    Location
    London, England
    MS-Off Ver
    2013 Professional
    Posts
    28

    Re: INDEX/MATCH array function returning nothing for some queries but not others

    Many many thanks, a silly error on my part. I'll be putting TRIM on everything in future!

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,239

    Re: INDEX/MATCH array function returning nothing for some queries but not others

    You would be far, far better off sanitising your data than adding TRIM to everything!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 04-02-2016, 08:16 PM
  2. index function error using match function to get data from a cell in an array
    By mabildgaard in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-17-2013, 02:21 AM
  3. Index, Match, Large Function returning duplicate names
    By RNeel55 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-08-2013, 04:09 PM
  4. Replies: 8
    Last Post: 06-29-2012, 10:20 PM
  5. Replies: 1
    Last Post: 08-17-2011, 06:33 PM
  6. Index/Match function inside an array
    By tittiot in forum Excel General
    Replies: 2
    Last Post: 01-20-2010, 09:48 PM
  7. Index and Match function returning same values
    By Climaxgp in forum Excel General
    Replies: 4
    Last Post: 12-15-2009, 05:59 AM

Tags for this Thread

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