+ Reply to Thread
Results 1 to 14 of 14

vlookups with multiple returns

  1. #1
    Registered User
    Join Date
    08-25-2008
    Location
    Sydney
    Posts
    9

    vlookups with multiple returns

    Hi

    I am trying to write a formula that will give more than 1 return for a vlookup statement.
    The info i am looking up is sku code (col a) and expiry date (col b).
    There are more than one entry for some skus , but I am only getting returned the first expiry date.
    Can anyone help?

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    you need an array lookup see attached formula in d2 is an array confirmed with ctrl+shift+enter then dragged down
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    08-25-2008
    Location
    Sydney
    Posts
    9
    Thanks Martin.

    Ideally i would want the info put into the rows rather than the columns following the data (as the lookups are in a table too) im afraid I can't get that to work.

    Can you explain what the formula is doing?

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    for across row you need
    =IF(COLUMN()-3>COUNTIF($A$1:$A$2000,$C2),"",INDEX($B$1:$B$2000,SMALL(IF(Sheet1!$A$1:$A$2000=$C2,ROW($A$1:$A$2000),""),COLUMN()-3)))
    the -3 after column() ,twice, depends on which col you wish to start the array from in this case col D so its 3 (col D=4 -3 to make the value 1 )so if it started in column M it would be -12 (13-12=1)
    just put it in d2 confirm drag across as many as you are probably expecting to get results for then drag all those rows at once down. you can then enter different values inc2,c3,an so on.

    as to how it works PFM!

  5. #5
    Registered User
    Join Date
    08-25-2008
    Location
    Sydney
    Posts
    9

    Smile

    Whats PFM?

    Thanks for the new formula. although I have copied and pasted it , its still not working.
    I will keep working on it

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    PFM = pure *&*%$£%$ magic

  7. #7
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561
    Use a pivot table!

    Post some data and I'll show you how powerful (quicker, faster, easier to understand) it can be.

    HTH

  8. #8
    Registered User
    Join Date
    08-25-2008
    Location
    Sydney
    Posts
    9
    Thanks

    This is the file I am trying to build.

    Step 1
    In sheet 1 i want to list all the batches for each sku code from sheet (330a)
    and also the expirey date , status and quantity.

    Step 2
    Using the forecast (bw forecast) i want to be able to analyse by sku , whether the forecast is enough so that each batch will get used before it is too old , or whether I will have any left.

    My ERP system should beable to do this , but it can't.

    If you can get this working it would save me about 3 full days work a month.

    Darren
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561
    Are you sure you've posted the right thing?

    If you have... give us a chance, it doesn't say "SKU" anywhere, nor does it have a sheet(330a)

    Please identify the base data and give an example of the ideal output.

    We want to help, but I'm not here to spend hours deciphering your intent!

  10. #10
    Registered User
    Join Date
    08-25-2008
    Location
    Sydney
    Posts
    9

    Smile

    Sorry cheeky charlie. I did post the wrong sheet.

    Please see attached now.

    In the OUTPUT sheet , i would like to get the 4 lines of info for each batch.Into the yellow cells.

    Batch,Quantity,Expiry and Status these are all available on sheet 330a.
    This I believe can be done by arrays , but cannot get them to work myself.

    I then want to use the info in these cells to determine if all of the quantitys I have in each batch will be consumed by the forecast (BW sheet). If there is any remainder I would like to see that isn the red squares. We do not sell anything with less than 9 months expiry on it.

    Hope this is enough info , and am genuinely grateful for the help I am getting here.

    Darren

  11. #11
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561
    attached...?

    I'm not too grumpy really, I just got a bit fed up wrestling with that workbook, now I understand why!

  12. #12
    Registered User
    Join Date
    08-25-2008
    Location
    Sydney
    Posts
    9
    oops.

    here you go.

  13. #13
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Zipped and <100K.

  14. #14
    Registered User
    Join Date
    08-25-2008
    Location
    Sydney
    Posts
    9
    Third time lucky
    Attached Files Attached Files

+ 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. VLOOKUP-How to process multiple returns?
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-01-2008, 11:31 AM
  2. vlookup returns multiple value
    By panproblems in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2008, 03:42 PM
  3. Multiple If Then Vlookups.
    By VegasL in forum Excel General
    Replies: 4
    Last Post: 03-16-2008, 11:49 PM
  4. Multiple Returns
    By Neflheim in forum Excel General
    Replies: 9
    Last Post: 12-29-2006, 08:21 PM
  5. multiple VLOOKUPs MIN and MAX
    By Poolio2000 in forum Excel General
    Replies: 4
    Last Post: 12-07-2006, 08:29 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