+ Reply to Thread
Results 1 to 11 of 11

Xlookup for 2 criteria to search

  1. #1
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Xlookup for 2 criteria to search

    Dear Guru

    I am trying to solve an issue

    Product Shop 1 Shop2
    Judge ABC
    PCRC ZZZ

    To locate the product either in Shop 1 or Shop 2

    I tried the Xlookup but seems not working


    Appreciated your help

    Eric
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Xlookup for 2 criteria to search

    Formula is available in G8.
    I am unable to upload the formula.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  3. #3
    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,945

    Re: Xlookup for 2 criteria to search

    You can only look up one column at a time. Try this instead:

    =XLOOKUP(H8,C7:C8,B7:B8,XLOOKUP(H8,D7:D8,B7:B8,"",0,1),0,1)
    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.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Xlookup for 2 criteria to search

    Non-array formula, expandable to any number of "Shops".

    =IFERROR(INDEX($6:$6,,AGGREGATE(15,6,COLUMN($C$7:$D$8)/($C$7:$D$8=$H$8),1)),"")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: Xlookup for 2 criteria to search

    Modifying from Ali's formula, =XLOOKUP(H8,C7:C8,TRANSPOSE(C6:D6),XLOOKUP(H8,D7:D8,TRANSPOSE(C6:D6),"",0,1),0,1)

  6. #6
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: Xlookup for 2 criteria to search

    Quote Originally Posted by josephteh View Post
    Modifying from Ali's formula, =XLOOKUP(H8,C7:C8,TRANSPOSE(C6:D6),XLOOKUP(H8,D7:D8,TRANSPOSE(C6:D6),"",0,1),0,1)
    Apparently, it's not working!

  7. #7
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Re: Xlookup for 2 criteria to search

    Dear Ali

    Thanks so much for your reply

    So how, after reading yours formula, I test this :=XLOOKUP(H8,C7:C9,B7:B9,XLOOKUP(H8,D7:D9,B7:B9),,1)

    It works as what I want.

    the case is, I have a registration form, that all user to input either Chinese name or English name ( column B or Column C)
    So I have to test/match their name to return the "Column B"

    Thanks for everyone here

    Eric
    Attached Files Attached Files

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Xlookup for 2 criteria to search

    ??? What is your expected answer???

  9. #9
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Re: Xlookup for 2 criteria to search

    Glenn

    The formula that i made is =XLOOKUP(H8,C7:C9,B7:B9,XLOOKUP(H8,D7:D9,B7:B9),,1)

    Your is good to, but just i need the return from Column "A"

    Thanks anyway

    Eric
    Attached Files Attached Files

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Xlookup for 2 criteria to search

    I read this:

    T"o locate the product either in Shop 1 or Shop 2"

    in your first post as meaning you wanted the shop name returned. For completeness:

    =IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW($C$7:$D$8)/($C$7:$D$8=$H$8),1)),"")

  11. #11
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Re: Xlookup for 2 criteria to search

    Glenn

    Thanks

    Eric

+ 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] I want to understand how the option search last to first in XLOOKUP works
    By HansDouwe in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-07-2022, 11:58 AM
  2. how to xlookup if the search keys are comma-separated.
    By tubony in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-27-2021, 09:06 PM
  3. Xlookup variable to search for defined by slicer
    By PrimePorkchop in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-30-2021, 05:33 PM
  4. [SOLVED] Combing SUMIF SEARCH and XLookup
    By Dustychops in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-23-2021, 02:24 PM
  5. Xlookup search for value in multiple cols
    By Jbk5u in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-01-2021, 02:10 AM
  6. [SOLVED] search data using xlookup function in excel?
    By rena80 in forum Excel General
    Replies: 0
    Last Post: 09-15-2021, 11:57 PM
  7. [SOLVED] Using IF, Xlookup and Match/search, to find value in array.
    By Lee_of_Excel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-16-2020, 12:09 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