+ Reply to Thread
Results 1 to 9 of 9

Xlookup several columns with multiple lookup values

  1. #1
    Registered User
    Join Date
    09-15-2021
    Location
    Australia
    MS-Off Ver
    Microsoft Office 365
    Posts
    35

    Xlookup several columns with multiple lookup values

    Hello,

    I was wondering if there is a formula that involves the Xlookup formula whereby, I can look up a value from several columns in one worksheet (e.g. the first tab) to see if it matches a value from several columns in another work sheet (e.g. the second tab), then return the corresponding value from the second worksheet (e.g. second tab)?

    Please see attached an example. In column E of the 'Outputs' tab, I would like to return the value from Column A of the 'Rankings' tab. To do this, I would like to look up all values from Columns A, B, C & D from the 'Outputs' tab and see if it matches the value in Columns B or C of the 'Rankings' tab. Is it possible to do this with the Xlookup formula?

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2404
    Posts
    1,259

    Re: Xlookup several columns with multiple lookup values

    Try in E2 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Good luck!

  3. #3
    Registered User
    Join Date
    09-15-2021
    Location
    Australia
    MS-Off Ver
    Microsoft Office 365
    Posts
    35

    Re: Xlookup several columns with multiple lookup values

    Quote Originally Posted by Estevaoba View Post
    Try in E2 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Good luck!
    Thanks Estevaoba! This works on the example spreadsheet I attached, but not on the actual data that I am working on (not provided). I think I should have said, if any of the values in Columns A, B, C OR D from the 'Outputs' tab matches the values in either Columns B OR C, then return the corresponding value in Column A of the 'Rankings' tab. Would I need to replace the ampersands in the formula to OR?

    Thank you!
    Last edited by Eades1412; 11-11-2021 at 11:49 PM. Reason: Failed to mention another important point

  4. #4
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,830

    Re: Xlookup several columns with multiple lookup values

    Well, there's probably a shorter way, but I think this works:

    In E2 and copy down:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-15-2021
    Location
    Australia
    MS-Off Ver
    Microsoft Office 365
    Posts
    35

    Re: Xlookup several columns with multiple lookup values

    Quote Originally Posted by Gregb11 View Post
    Well, there's probably a shorter way, but I think this works:

    In E2 and copy down:

    Please Login or Register  to view this content.
    Thanks for your reply, Gregb11! Whilst I do prefer shorter formulas, the one you provided also works, so I can definitely use this one if I am unable to get the same results with a shorter formula. Thanks for your help!

  6. #6
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Xlookup several columns with multiple lookup values

    Another not small solution (could be smaller with LET() function, but I don't have it because of Win7).

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by DJunqueira; 11-12-2021 at 10:14 AM.

  7. #7
    Registered User
    Join Date
    09-15-2021
    Location
    Australia
    MS-Off Ver
    Microsoft Office 365
    Posts
    35

    Re: Xlookup several columns with multiple lookup values

    Quote Originally Posted by DJunqueira View Post
    Another not small solution (could be smaller with LET() function, but I don't have it because of Win7).

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thank you for this, DJunqueira! Yes, this formula also works! I will keep this one in mind too if I can't find a shorter solution.

    The one that was first proposed by Estevaoba worked very well and is ideal (as the formula is a lot more straight-forward and shorter). However, for some reason, it did not find a match on row 19 on my example workbook. Does anyone know why?

    Thanks in advance!

  8. #8
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Xlookup several columns with multiple lookup values

    Quote Originally Posted by Eades1412 View Post
    Thank you for this, DJunqueira! Yes, this formula also works! I will keep this one in mind too if I can't find a shorter solution.
    The one that was first proposed by Estevaoba worked very well and is ideal (as the formula is a lot more straight-forward and shorter). However, for some reason, it did not find a match on row 19 on my example workbook. Does anyone know why?
    Thanks in advance!
    I would say that you can't compare 4 columns with 2 columns that way. If cell A is in Ranking column C you won't find it that way, also an order problem.

    Thank you for your reply, since you want the answer in one column consecutively I don't see other better way...

  9. #9
    Registered User
    Join Date
    09-15-2021
    Location
    Australia
    MS-Off Ver
    Microsoft Office 365
    Posts
    35

    Re: Xlookup several columns with multiple lookup values

    Quote Originally Posted by DJunqueira View Post
    I would say that you can't compare 4 columns with 2 columns that way. If cell A is in Ranking column C you won't find it that way, also an order problem.

    Thank you for your reply, since you want the answer in one column consecutively I don't see other better way...
    Ah I see! That's such a shame. I guess the longer formulas will have to do.

    Thanks everyone for your helpful responses!

+ 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: 7
    Last Post: 07-16-2021, 11:04 AM
  2. [SOLVED] Xlookup multiple columns
    By sunboy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-12-2021, 11:45 AM
  3. Replies: 1
    Last Post: 02-12-2021, 07:21 PM
  4. Replies: 1
    Last Post: 05-12-2020, 08:42 AM
  5. Replies: 3
    Last Post: 04-08-2014, 03:11 AM
  6. Formula to lookup multiple text values in multiple columns
    By karimk in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-04-2013, 05:33 AM
  7. lookup multiple values in multiple columns to return a result
    By AYAHOO123 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-11-2013, 07:53 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