+ Reply to Thread
Results 1 to 9 of 9

Vlookup consecutive matches

  1. #1
    Registered User
    Join Date
    01-28-2018
    Location
    St. Louis, MO
    MS-Off Ver
    2010
    Posts
    10

    Vlookup consecutive matches

    Below is similar to the table I am using. I need to lookup both LOT and VAR and return a PAL and then in the next cell I need to lookup what the next match is. So the return table is kinda like a summary of the LOT + VAR listing all the PAL matches in separate cells. Any idea how to construct such a lookup?

    Lookup
    Lot Var Pal
    BP18001 BLB 12X6 029
    AG18001 BLB 12X6 001
    BP18001 BLB 12X6 027
    HS18001 BLB 12X6 002
    BP18001 BLB 1P 023


    RETURN
    BP18001 BLB 12X6
    029
    027
    Last edited by MJetter; 01-28-2018 at 03:06 PM.

  2. #2
    Forum Contributor
    Join Date
    03-30-2016
    Location
    Gillette, WY
    MS-Off Ver
    Office 365
    Posts
    230

    Re: Vlookup consecutive matches

    Please attach a sample of your data in an Excel File. Include enough data to be a little more representative of your data set. Go Advanced>Manage Attachments>Choose File>Upload>Close Window.

  3. #3
    Registered User
    Join Date
    01-28-2018
    Location
    St. Louis, MO
    MS-Off Ver
    2010
    Posts
    10

    Re: Vlookup consecutive matches

    @TFiske Here you are.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,555

    Re: Vlookup consecutive matches

    Hello MJetter and Welcome to Excel Forum.
    Using the data in post #1, an array entered formula* that will yield the expected results (see attached file) is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    *Array entered formulas are confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,555

    Re: Vlookup consecutive matches

    MJetter, I received your message.
    1) Select only the first cell into which you want the results displayed and paste the formula into the formula bar,
    2) Be sure to enter as an array (simultaneously press Ctrl, Shift and Enter) before you copy down the column.
    3) I doubt that a 30 sheet workbook could be uploaded as the limit is 1000 Kb so if 1 and 2 don't resolve the issue I would suggest making a workbook with perhaps two sheets and even then we should only need a small amount of data to work with.
    4) I am including the file from post #4, I changed the last entry so that the 'VAR' is BLB 12X6 and the formula automatically picked it up.
    Let us know if you have any questions.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-28-2018
    Location
    St. Louis, MO
    MS-Off Ver
    2010
    Posts
    10

    Re: Vlookup consecutive matches

    I've uploaded a fragment of the file with just the sheets involved left in. If you go to the Blb sheet and look at row 4 you will see the cells I'm trying to get this to work for. The data is being pulled from the Resources sheet.
    Attached Files Attached Files

  7. #7
    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,032

    Re: Vlookup consecutive matches

    Use this, in C4, copied across:

    =IFERROR(INDEX(Resources!$D:$D,AGGREGATE(15,6,ROW(RLOT)/((RLOT=$E$1)*(RVAR=$K$2)),COLUMNS($C:C))),"")
    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

  8. #8
    Registered User
    Join Date
    01-28-2018
    Location
    St. Louis, MO
    MS-Off Ver
    2010
    Posts
    10

    Re: Vlookup consecutive matches

    That did it, Glenn. Appreciate it.
    Thanks for the help everyone. I bashed my head against this for weeks.

  9. #9
    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,032

    Re: Vlookup consecutive matches

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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] Vlookup against two matches
    By crazydude80 in forum Excel General
    Replies: 5
    Last Post: 02-19-2017, 04:32 PM
  2. [SOLVED] Consecutive cells match a defined sequence then vlookup
    By IndigoSK in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-15-2015, 03:19 AM
  3. [SOLVED] Count number of occurrences but if there are consecutive matches count them as one
    By michaljireht in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-26-2013, 08:26 PM
  4. Display Cell within VLookup range that excel thinks matches the VLookup Value
    By headachexcelperson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-04-2013, 04:56 PM
  5. [SOLVED] VLOOKUP all matches
    By Jiptastic in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-22-2013, 05:25 PM
  6. [SOLVED] How to search each consecutive column if a certain field matches?
    By hockeyadc in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-07-2013, 02:53 PM
  7. Trying to use VLOOKUP with 2 matches?
    By Zaraf in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-19-2008, 01:20 AM

Tags for this Thread

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