+ Reply to Thread
Results 1 to 7 of 7

Left Lookup to Return Multiple Values Given 2 Criteria

  1. #1
    Registered User
    Join Date
    05-14-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    45

    Left Lookup to Return Multiple Values Given 2 Criteria

    Hi All,

    THis is way out of my league so help would very gratefully appreciated.

    On the attached workbook, I have 2 sheets - a DATA sheet with the lookup table and a PLAN sheet where I wish to populate a list of Job Ref given 2 criteria on that sheet - Date and Crew. The formular I require is in E6 to E13 on the Plan sheet given the criteria in cells B2 (date) and B6 (crew). I have pasted in the expected results given the 2 criteria shown which returns 4 jobs.

    Also, the data set on the DATA sheet will increase/decrease daily as the sheet is updated.

    Hope this makes sense. Thanks.

    Capture.JPG
    Attached Files Attached Files

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,939

    Re: Left Lookup to Return Multiple Values Given 2 Criteria

    0001 99PDGH
    0001 99QQXS
    0001 99QYSK
    0081 00RWWC
    Why the above in E4:E9
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Registered User
    Join Date
    05-14-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: Left Lookup to Return Multiple Values Given 2 Criteria

    Hi, So given the 2 criteria on the PLAN sheet, the list needs to search for all matching criteria in columns AX (date) and AY (crew) on the DATA sheet and list the values in column A.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Left Lookup to Return Multiple Values Given 2 Criteria

    You've removed a lot of data from your sample file, but I assume that column BG is the next available column on the Data sheet, so put this formula in BG2:

    =IF(OR(AX2="",AY2=""),"-",AY2&"_"&AX2&"_"&COUNTIF(BG$1:BG1,AY2&"_"&AX2&"*")+1)

    Copy this down to beyond the bottom of your data, to accommodate more data being added. Then you can have this formula in cell E6 of the Plan sheet:

    =IFERROR(INDEX(DATA!$A:$A,MATCH($B$6&"_"&E$4&"_"&$D6,DATA!$BG:$BG,0)),"")

    and you can copy this down to E13. Then you can copy the block E6:E13 across into H6, K6, N6 etc. to complete that week.

    If you want to have another crew in B15, then you can copy the block D6:W13 into D15, and while the block is still highlighted, do CTRL-H (Find & Replace) and change B$6 to B$15. Repeat for blocks further down.

    Hope this helps.

    Pete

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,939

    Re: Left Lookup to Return Multiple Values Given 2 Criteria

    E6=IFERROR(INDEX(DATA!$A:$A,SMALL(INDEX(((DATA!$AX$2:$AX$508<>E$4)+(DATA!$AY$2:$AY$508<>LOOKUP("ZZZZZZZ",$B$6:$B6)))*10^10+ROW(DATA!$A$2:$A$508),0),$D6)),"")
    Please Login or Register  to view this content.
    Try this and copy across

    Note: There must be a SI Number in Column D

  6. #6
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,992

    Re: Left Lookup to Return Multiple Values Given 2 Criteria

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Use this formula in E6 with Ctrl+Shift+Enter and copy it down.

    Thanks
    Ankur

  7. #7
    Registered User
    Join Date
    05-14-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: Left Lookup to Return Multiple Values Given 2 Criteria

    A thousand thanks for this formula which works fantastically. Not quite sure where the "ZZZZZZZ" comes in.

    Thanks Pete_UK for giving this a go.... I did think about using a Helper column. However, nflsales has nailed it.

+ 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: 4
    Last Post: 05-19-2015, 08:42 PM
  2. [SOLVED] Lookup Values which meet two or more criteria and return multiple matches horizontally
    By josetmg in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-03-2015, 01:16 AM
  3. Replies: 7
    Last Post: 08-04-2013, 03:41 PM
  4. Lookup/ Return and concatenate values based upon multiple criteria
    By steveboise in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-15-2013, 10:43 AM
  5. Replies: 10
    Last Post: 02-19-2013, 12:05 PM
  6. Replies: 3
    Last Post: 11-03-2010, 04:05 AM
  7. left lookup - return multiple values
    By IanJ in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-15-2006, 01:13 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