+ Reply to Thread
Results 1 to 6 of 6

XLookup formula returns FALSE only for some rows

  1. #1
    Registered User
    Join Date
    08-08-2018
    Location
    Bangkok
    MS-Off Ver
    MS365 for Mac (latest version)
    Posts
    96

    XLookup formula returns FALSE only for some rows

    Hello Gurus,

    I am trying to get a return value in a column depending on the name of a software a factory uses.
    I did what I thought was a simple formula but in returns "False" for some rows.

    Formula: =IF(O4="opera",XLOOKUP($A$1,Factory[Code],Factory[Employees],IF(O4="Symphony",XLOOKUP($A$1,Factory[Code],Factory[POS],IF(O4="Material control",XLOOKUP($A$1,Factory[Code],Factory[POS],IF(O4="sun",XLOOKUP($A$1,Factory[Code],Factory[SUN]))))))))

    File attached

    Thanks a lot
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,020

    Re: XLookup formula returns FALSE only for some rows

    Your formula is nested incorrectly. Your nested IF functions are inside each XLOOKUP. You need to have each option at the top level, not nesting them. The best way to do this is with the IFS function. See attached file.

    Here is what the updated formula looks like broken out to show the logical structure:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,795

    Re: XLookup formula returns FALSE only for some rows

    Personally I avoid using IFS as it is far less efficient than a nested IF, so it would be
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: XLookup formula returns FALSE only for some rows

    Please try

    =INDEX(Factory,XMATCH(A1,Factory[Code]),XMATCH(SWITCH(O4:O15,"opera","Employees","sun","SUN","POS"),Factory[#Headers]))
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-08-2018
    Location
    Bangkok
    MS-Off Ver
    MS365 for Mac (latest version)
    Posts
    96

    Re: XLookup formula returns FALSE only for some rows

    Thank you everyone, all worked like a charm 😊

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,795

    Re: XLookup formula returns FALSE only for some rows

    Glad to help & thanks for the feedback.

+ 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] Nested XLOOKUP formula returns #value error
    By mo1h43v in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-11-2023, 08:56 AM
  2. Replies: 8
    Last Post: 11-30-2022, 03:11 PM
  3. [SOLVED] Use a formula if my IF function returns a false?
    By LXPF in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-08-2019, 12:40 PM
  4. [SOLVED] Trouble with IF Formula (returns False)
    By maym in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-11-2017, 01:03 AM
  5. [SOLVED] Formula always returns False instead of value, Why?
    By p1awn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2017, 01:03 AM
  6. [SOLVED] Formula Returns False
    By Rain Quintero in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-02-2015, 02:48 AM
  7. [SOLVED] Getting #VALUE! error if formula returns false.
    By Jhail83 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-13-2013, 04:56 PM

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