+ Reply to Thread
Results 1 to 9 of 9

Xlookup returns "-" but not the return array's value

  1. #1
    Forum Contributor
    Join Date
    06-20-2021
    Location
    UK
    MS-Off Ver
    2016
    Posts
    126

    Unhappy Xlookup returns "-" but not the return array's value

    Definitions of variables:

    Book1 (main file where we will store output values from xlookup): Cell "A3" = LookUpVal
    Book 2 (source data): Col G = RetArr; Col A = SrcArr


    Problem 1:

    Without using address property with search and return arrays, in the arguments of Xlookup, it doesn't even work (Error: unable to get Xlookup property of worksheet function class).

    Problem 2:

    The return value in book 1 is empty i.e. "-" as supplied in xlookup argument.

    What I have tried:


    1. Without address and with address in Xlookup

    2. Checked values in srcArr, LookupVal and retArr to be correct. This was check through srcArr.select as well as looping through debug.print cells value. So I know it is selecting the right ranges, and values.

    3. Checked workbook values, and they are correct alongside sheet names.



    Please Login or Register  to view this content.
    If I can past the hurdle of actually getting return values from the search array, then I will be on my way to loop through each lookup value and put it inside test worksheet.

    Due to company policy any workbook upload is blocked but I want Xlookup to read from yellow columns essentially. I am testing this code on cols A and G only.


    XlookUpToSave.png

    ReturnArray.png
    Last edited by immigrated4urjob; 09-16-2021 at 08:59 AM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Xlookup returns "-" but not the return array's value

    Try get rid of .Address
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    06-20-2021
    Location
    UK
    MS-Off Ver
    2016
    Posts
    126

    Re: Xlookup returns "-" but not the return array's value

    That was problem 1. It gives xlookup unable to get property of worksheet function class.
    Last edited by AliGW; 09-16-2021 at 10:37 AM. Reason: PLEASE don't quote unnecessarily!

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Xlookup returns "-" but not the return array's value

    If the code reaches to that line, it should work.(assuming using O.365)

    condition
    Book2 is active, otherwise the code should throw the error at
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-20-2021
    Location
    UK
    MS-Off Ver
    2016
    Posts
    126

    Re: Xlookup returns "-" but not the return array's value

    It is 365 yes.
    Last edited by AliGW; 09-16-2021 at 10:36 AM. Reason: PLEASE don't quote unnecessarily!

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Xlookup returns "-" but not the return array's value

    Tested here with 2 workbooks and it is working here, so no idea why it does not work there.

  7. #7
    Forum Contributor
    Join Date
    06-20-2021
    Location
    UK
    MS-Off Ver
    2016
    Posts
    126

    Re: Xlookup returns "-" but not the return array's value

    I test here on my two workbooks, ensured these weren't csv files, and also did it on another copy of the same workbooks. The debuggers till throws that error that it can't use xlookup property???
    Last edited by AliGW; 09-16-2021 at 10:36 AM. Reason: PLEASE don't quote unnecessarily!

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Xlookup returns "-" but not the return array's value

    Ahhh..
    I tested here under srcArr and retArr are the same size, that you don't...
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-20-2021
    Location
    UK
    MS-Off Ver
    2016
    Posts
    126

    Re: Xlookup returns "-" but not the return array's value

    What the actual f? It worked when I made srcArr and retArr the same row number...You are absolute legend mate.

    Logically I don't know why starting row should match for both.

+ 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. [SOLVED] XLookup reusing "old" return value
    By norgaards in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-17-2021, 10:28 AM
  2. Replies: 4
    Last Post: 07-10-2014, 08:10 PM
  3. CHOOSE Function returns "#VALUE!" when using an array
    By wolf83 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-25-2013, 09:37 PM
  4. Replies: 2
    Last Post: 10-24-2011, 05:30 AM
  5. Replies: 3
    Last Post: 02-16-2011, 02:55 PM
  6. Formula returns "0"; How do I make it return nothing?
    By jonlandrum in forum Excel General
    Replies: 5
    Last Post: 04-18-2006, 07:40 PM
  7. [SOLVED] If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ...
    By Maria J-son in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2006, 08:25 AM

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