+ Reply to Thread
Results 1 to 4 of 4

Lookup multiple instances of value in ws2 and return data to WS1

  1. #1
    Registered User
    Join Date
    08-12-2013
    Location
    darwen, england
    MS-Off Ver
    excel 2010
    Posts
    2

    Lookup multiple instances of value in ws2 and return data to WS1

    Hi all,

    My first post so please be gentle, my terminology may be off and i am certainly no excel expert, apologies if i overcomplicate a process which you find simple!!

    I am attempting to create an invoice on WS1 that will autofill with data from WS2 and using an order id as lookup value..

    each item from a single order is on a separate row in WS2 with an identicle Order_id in column 1 so VLOOKUP only returns the first instance of the value, i gather that INDEX needs to be used in some way but i am not fluent enough in excel to work out how to do this, please help!

    Simplified workbook is attached
    invoice example.xlsx

    on WS2 there is three rows with the same order id in column 1, i need to reference these rows on WS1 using the same order id as lookup value

    i have used a VLOOKUP for the first row in the invoice to illustrate what it should look like but obviously VLOOKUP only returns the first instance of the value so i need to know the formula to return each row with that instance on separate rows on WS1

    Hope this makes sense, apologies for the lack of proper terminology or incorrect terminology if applicable!!

    Please help before i tear out my own eyeballs in frustration

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Lookup multiple instances of value in ws2 and return data to WS1

    Hi

    In B3 and copy down use this ARRAY formula.

    =IFERROR(INDEX(Order_Report!$B$2:$B$20,SMALL(IF(Order_Report!$A$2:$A$20=$B$1,ROW(Order_Report!$B$2:$B$20)-1),ROW(Order_Report!B1))),"")

    In C3 and copy down and across until E3 this Also ARRAY formula

    =IFERROR(INDEX(Order_Report!C$2:C$20,MATCH($B$1&$B3,Order_Report!$A$2:$A$20&Order_Report!$B$2:$B$20,0)),"")


    -- Array(CSE) { }, formulae are confirmed with Control+Shift+Enter.
    Not just Enter.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    08-12-2013
    Location
    darwen, england
    MS-Off Ver
    excel 2010
    Posts
    2

    Re: Lookup multiple instances of value in ws2 and return data to WS1

    Hi Fotis,

    Many thanks for the fast response, this is exactly what i needed.

    As mentioned i am a noob though, would you mind explaining the formula in simple terms?

    I need to now edit the formula to work with the actual worksheets i am using but cannot publicly post these due to sensitive customer info, if you are able to make me understand how these functions actually work i would really appreciate it.

    If it's too much to ask then thanks very much for the help you have already provided, i'll figure it out with a bit of tinkering i'm sure!

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Lookup multiple instances of value in ws2 and return data to WS1

    You are welcome and thanks for the feed back.

    =IFERROR(INDEX(Order_Report!$B$2:$B$20,SMALL(IF(Order_Report!$A$2:$A$20=$B$1,ROW(Order_Report!$B$2:$B$20)-1),ROW(Order_Report!B1))),"")

    The INDEX part of the formula is the range that we will get our results.

    The SMALL(IF part of the formula is the range that will try to match the B1 value.

    The ROW part of the formula is actually say to our formula in which row will start searcing..As your data start in row 2 we use -1. If were started in row 5 then we should use [B]-4[/B ] ROW(Order_Report!$B$2:$B$20)-1)

    and finally.. this part..ROW(Order_Report!B1))) gives us the first result . As we drag down gives us the second result..ROW(Order_Report!B2)))..the third ..ROW(Order_Report!B3))) etc....

    Hope that helps you

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

+ 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] Complex VLOOKUP, multiple instances vertical, return subsequent instances horizontally
    By Miles_2804 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-12-2013, 11:54 AM
  2. Replies: 14
    Last Post: 01-22-2013, 11:19 PM
  3. [SOLVED] Lookup for multiple instances
    By sonyaswan in forum Excel General
    Replies: 2
    Last Post: 07-17-2012, 08:26 AM
  4. Need to return multiple instances using lookup
    By fugee7 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-01-2011, 02:11 PM
  5. lookup multiple instances
    By NathanR in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-14-2007, 07:03 PM

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