+ Reply to Thread
Results 1 to 17 of 17

XLOOKUP with multiple search criteria and multiple return values

  1. #1
    Registered User
    Join Date
    02-22-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    72

    XLOOKUP with multiple search criteria and multiple return values

    Hi,

    See attached sheet. Is this lookup possible?
    Attached Files Attached Files

  2. #2
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: XLOOKUP with multiple search criteria and multiple return values

    close try this instead:

    =CHOOSE({1,2},XLOOKUP(D2,M:M,N:N),XLOOKUP(D2,O:O,P:P))
    <----- If you are happy with your solution please click on the "* Add Reputation" as a way to say thank you.

  3. #3
    Registered User
    Join Date
    02-22-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    72

    Re: XLOOKUP with multiple search criteria and multiple return values

    I'm getting #SPILL!
    Last edited by Cuni; 10-25-2022 at 11:42 AM.

  4. #4
    Registered User
    Join Date
    02-22-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    72

    Re: XLOOKUP with multiple search criteria and multiple return values

    Quote Originally Posted by dosydos View Post
    close try this instead:

    =CHOOSE({1,2},XLOOKUP(D2,M:M,N:N),XLOOKUP(D2,O:O,P:P))
    I'm getting #SPILL!

  5. #5
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,792

    Re: XLOOKUP with multiple search criteria and multiple return values

    E2=SUMPRODUCT(($M$2:$O$5=D2)*(N(+($N$2:$P$5))))

    Copy down

  6. #6
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: XLOOKUP with multiple search criteria and multiple return values

    if you are getting spill error that means there is data below or to the side of it so it can't show all results. just delete the excess data and you should be good

  7. #7
    Registered User
    Join Date
    02-22-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    72
    Quote Originally Posted by dosydos View Post
    if you are getting spill error that means there is data below or to the side of it so it can't show all results. just delete the excess data and you should be good

    Thanks I will check tomorrow again.

  8. #8
    Registered User
    Join Date
    02-22-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    72
    Quote Originally Posted by CARACALLA View Post
    E2=SUMPRODUCT(($M$2:$O$5=D2)*(N(+($N$2:$P$5))))

    Copy down

    Thank you. I find this one difficult to grasp.

    I prefer XLOOKUP with CHOOSE provided I can make it work

  9. #9
    Registered User
    Join Date
    02-22-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    72

    Re: XLOOKUP with multiple search criteria and multiple return values

    Attachment 802301
    Not able to make it work...

  10. #10
    Registered User
    Join Date
    02-22-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    72

    Re: XLOOKUP with multiple search criteria and multiple return values

    Attachment 802302
    Not even this is working. It should who 10 in E2 and 22 in F2...

  11. #11
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: XLOOKUP with multiple search criteria and multiple return values

    Provide a workbook with your expected results mocked up MANUALLY, NOT a non-working formula.
    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.

  12. #12
    Registered User
    Join Date
    02-22-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    72

    Re: XLOOKUP with multiple search criteria and multiple return values

    Here is the solution I'm looking for. I put in the values manually but would like to solve it with formula starting in E2.
    Attached Files Attached Files

  13. #13
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: XLOOKUP with multiple search criteria and multiple return values

    One way:

    =SUMPRODUCT(($M$2:$M$3=D2)*($N$2:$N$3))+SUMPRODUCT(($O$2:$O$3=D2)*($P$2:$P$3))
    Attached Files Attached Files

  14. #14
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: XLOOKUP with multiple search criteria and multiple return values

    Another (365) way:

    =LET(v,VSTACK($M$2:$N$3,$O$2:$P$3),VLOOKUP(D2,v,2,0))
    Attached Files Attached Files

  15. #15
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,792

    Re: XLOOKUP with multiple search criteria and multiple return values

    E2=SUMIF($M$2:$O$3,$D2,$N$2:$P$3)

    Copy down

  16. #16
    Registered User
    Join Date
    02-22-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    72

    Re: XLOOKUP with multiple search criteria and multiple return values

    Thank you all!

  17. #17
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: XLOOKUP with multiple search criteria and multiple return values

    Glad to have helped.

+ 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. search multiple criteria and return multiple values within the same cell
    By winsomeness in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-16-2022, 04:59 AM
  2. Xlookup return maximum value for multiple criteria
    By Excelforum2020 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-09-2021, 10:18 AM
  3. [SOLVED] XLOOKUP to return cell based on multiple criteria in single column
    By mikehay08 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-24-2021, 02:59 PM
  4. [SOLVED] Return Multiple values from a column with index and match, and search criteria
    By marcusduton in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 02-15-2015, 09:59 PM
  5. [SOLVED] Return multiple values using three search criteria
    By knightjob in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-09-2014, 03:25 PM
  6. Replies: 7
    Last Post: 08-04-2013, 03:41 PM
  7. [SOLVED] How to return multiple values that match a single search criteria?
    By JSallen in forum Excel General
    Replies: 4
    Last Post: 11-28-2012, 11:49 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