+ Reply to Thread
Results 1 to 25 of 25

Lookup table help - multiple returns for one lookup value

  1. #1
    Forum Contributor
    Join Date
    10-25-2011
    Location
    Preston, England
    MS-Off Ver
    Excel 2016
    Posts
    136

    Unhappy Lookup table help - multiple returns for one lookup value

    Hi,

    I'm hoping you can help with a formula I'm trying to work out.

    It is to help with supply and demand.

    I have a table where the left column contains a part number, on another sheet I have an order book which shows a list of due in dates for the part numbers. I want to look up the part number against the order book and return the first due date for the part number in the first column, then in the second column show the next due date for the part number and so on.

    I've attached an example. Can anyone advise?

    Thanks
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Lookup table help - multiple returns for one lookup value

    Here is a solution that adds a helper column to your Orderbook sheet.
    Attached Files Attached Files
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Lookup table help - multiple returns for one lookup value

    Try this formula in B2 and copy down and right
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup table help - multiple returns for one lookup value

    This array formula** entered in B2:

    =IFERROR(INDEX(Orderbook!$B:$B,SMALL(IF(Orderbook!$A$2:$A$22=$A2,ROW(Orderbook!A$2:A$22)),COLUMNS($B2:B2))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Format as Date

    Copy across to H2 then down as needed.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    09-14-2016
    Location
    New York, USA
    MS-Off Ver
    Mac 2016, Windows 2016
    Posts
    14

    Re: Lookup table help - multiple returns for one lookup value

    In addition to the above solutions, I might consider adding a column on the demand tab that counts the number of due dates if there can potentially be more than 7.
    Then maybe a flag or conditional format to highlight any greater than 7...just to make sure all of your data is being accounted for.
    Just a thought...

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2502
    Posts
    13,700

    Re: Lookup table help - multiple returns for one lookup value

    Another way. Array-entered in B2 of 'demand' filled down and across (re-format for date).
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Dave

  7. #7
    Forum Contributor
    Join Date
    10-25-2011
    Location
    Preston, England
    MS-Off Ver
    Excel 2016
    Posts
    136

    Question Re: Lookup table help - multiple returns for one lookup value

    Hi,

    Thanks so much for all the help so far. You guys are like wizards!

    So there is an additional complexity which I didn't originally share as I hoped I could just nest your formula in my lookup.

    What I have is a separate "Demand" sheet listing whether there is an open demand for a part number against the contract. I use a helper column to concatenate the contract number and part number and do a lookup from my "Supply" sheet which shows me if there is an open demand or whether the demand is complete
    . I want the "Supply" table to check the "Demand" table and check whether there is a demand, if there is I want to reference the "orderbook" and fill in the open demands with the next available delivery date. There is one added complexity that are two contract types "SD" and "MA" and an "SD" part cannot be used on an "MA" contract (and vice versa).

    I've attached an updated workbook which should provide the necessary raw data to accomplish the task. Thanks again.

    I appreciate the help.

  8. #8
    Forum Contributor
    Join Date
    10-25-2011
    Location
    Preston, England
    MS-Off Ver
    Excel 2016
    Posts
    136

    Re: Lookup table help - multiple returns for one lookup value

    I've been reading up and trying things out all day and I'm stumped

  9. #9
    Registered User
    Join Date
    09-14-2016
    Location
    New York, USA
    MS-Off Ver
    Mac 2016, Windows 2016
    Posts
    14

    Re: Lookup table help - multiple returns for one lookup value

    Could you just pop it in a pivot table real quick?
    You could even add month and year fields to filter it down.

  10. #10
    Registered User
    Join Date
    09-14-2016
    Location
    New York, USA
    MS-Off Ver
    Mac 2016, Windows 2016
    Posts
    14

    Re: Lookup table help - multiple returns for one lookup value

    Parts number in rows.
    Date in columns.
    Parts number is values.

    Put month/year filters if used.

  11. #11
    Forum Contributor
    Join Date
    10-25-2011
    Location
    Preston, England
    MS-Off Ver
    Excel 2016
    Posts
    136

    Re: Lookup table help - multiple returns for one lookup value

    Hi,
    I've tried a pivot but its not going to achieve what I want which is P/N down the left column, project number across the top, each corresponding cell showing if the demand has been fulfilled, if not, when is the next expected due date sequentially

  12. #12
    Registered User
    Join Date
    09-14-2016
    Location
    New York, USA
    MS-Off Ver
    Mac 2016, Windows 2016
    Posts
    14

    Re: Lookup table help - multiple returns for one lookup value

    Oh sorry. I missed the updated file. I'll take another crack at it after lunch.

  13. #13
    Forum Contributor
    Join Date
    10-25-2011
    Location
    Preston, England
    MS-Off Ver
    Excel 2016
    Posts
    136
    Quote Originally Posted by AlRicotta View Post
    Oh sorry. I missed the updated file. I'll take another crack at it after lunch.
    Can anyone help please? Thanks

  14. #14
    Registered User
    Join Date
    09-14-2016
    Location
    New York, USA
    MS-Off Ver
    Mac 2016, Windows 2016
    Posts
    14

    Re: Lookup table help - multiple returns for one lookup value

    I sent you a pm. I came up with a solution, but I can't upload the attachment for some reason.

  15. #15
    Registered User
    Join Date
    09-14-2016
    Location
    New York, USA
    MS-Off Ver
    Mac 2016, Windows 2016
    Posts
    14

    Re: Lookup table help - multiple returns for one lookup value

    I think I figured out the attachment thing (sorry I'm new here).
    Does this solution work for you?

  16. #16
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2502
    Posts
    13,700

    Re: Lookup table help - multiple returns for one lookup value

    Not sure I've grasped the concept, yet.

    There is a helper row (row 9) 'supply'. Formula in B9 and filled across
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then this array-entered (Ctrl + Shift + Enter) formula in B12 filled down and across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    9
    SD SD SD SD SD SD SD MA MA MA MA
    10
    Project
    11
    Part No SD1 SD2 SD3 SD4 SD5 SD6 SD7 MA1 MA2 MA3 MA4
    12
    A091323
    10/30/2016
    11/15/2016
    11/15/2016
    11/15/2016
    Complete
    Complete
    Complete
    11/15/2016
    11/15/2016
    Complete
    Complete
    13
    A091336
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    14
    A111145
    1/1/2025
    1/1/2025
    1/1/2025
    1/1/2025
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    15
    A130759
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    16
    A130761
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    17
    A131753
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete

  17. #17
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Lookup table help - multiple returns for one lookup value

    I know that's look uglier but this will solve your problem.
    On B12 :
    Please Login or Register  to view this content.
    Now copy right and down.
    Last edited by sanram; 09-15-2016 at 09:30 PM.

  18. #18
    Forum Contributor
    Join Date
    10-25-2011
    Location
    Preston, England
    MS-Off Ver
    Excel 2016
    Posts
    136

    Re: Lookup table help - multiple returns for one lookup value

    Quote Originally Posted by AlRicotta View Post
    I think I figured out the attachment thing (sorry I'm new here).
    Does this solution work for you?
    Hi AlRicotta,

    Thanks for your effort but I'm afraid it doesn't achieve what I'm looking for. The supply table with the conditional formatting looks up against the demand sheet and if it finds a match I need it to populate from left to right to show the next expected delivery date. I have manually entered the data in this attachment to show what I am trying to achieve. I've left in the previous attempts for comparison.

    Thanks in advance

  19. #19
    Forum Contributor
    Join Date
    10-25-2011
    Location
    Preston, England
    MS-Off Ver
    Excel 2016
    Posts
    136

    Re: Lookup table help - multiple returns for one lookup value

    Quote Originally Posted by FlameRetired View Post
    Not sure I've grasped the concept, yet.

    There is a helper row (row 9) 'supply'. Formula in B9 and filled across
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then this array-entered (Ctrl + Shift + Enter) formula in B12 filled down and across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    9
    SD SD SD SD SD SD SD MA MA MA MA
    10
    Project
    11
    Part No SD1 SD2 SD3 SD4 SD5 SD6 SD7 MA1 MA2 MA3 MA4
    12
    A091323
    10/30/2016
    11/15/2016
    11/15/2016
    11/15/2016
    Complete
    Complete
    Complete
    11/15/2016
    11/15/2016
    Complete
    Complete
    13
    A091336
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    14
    A111145
    1/1/2025
    1/1/2025
    1/1/2025
    1/1/2025
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    15
    A130759
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    16
    A130761
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    17
    A131753
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Complete
    Hi Dave,

    Thank you, this is the closest so far but the demand lookup isn't accurate and I can't work out why.

    Project
    Part No SD1 SD2 SD3 SD4 SD5 SD6 SD7 MA1 MA2 MA3 MA4
    A091323 Demand Demand Demand Demand Demand Demand Demand Demand Demand Demand Demand
    A091336 Complete Complete Demand Complete Complete Complete Complete Complete Complete Demand Complete
    A111145 Demand Demand Demand Demand Demand Complete Demand Demand Demand Complete Demand
    A130759 Complete Complete Demand Complete Demand Complete Complete Complete Complete Demand Complete
    A130761 Complete Complete Demand Demand Complete Demand Demand Complete Complete Demand Demand
    A131753 Complete Complete Complete Demand Complete Complete Complete Complete Complete Complete Complete

    I don't know how to paste the table in but the lookup should return the following demand picture.

    Thanks

  20. #20
    Forum Contributor
    Join Date
    10-25-2011
    Location
    Preston, England
    MS-Off Ver
    Excel 2016
    Posts
    136

    Re: Lookup table help - multiple returns for one lookup value

    Quote Originally Posted by sanram View Post
    I know that's look uglier but this will solve your problem.
    On B12 :
    Please Login or Register  to view this content.
    Now copy right and down.
    Thank you Sanram, however when using your formula the cells are populated by either "Complete" or "Demand", whereas the demand cells should display the first date.

  21. #21
    Forum Contributor
    Join Date
    10-25-2011
    Location
    Preston, England
    MS-Off Ver
    Excel 2016
    Posts
    136

    Re: Lookup table help - multiple returns for one lookup value

    For anyone looking at this, the attached file has a manually entered table displaying what I'm trying to achieve.

    Thanks

  22. #22
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Slough
    MS-Off Ver
    Excel 2007
    Posts
    469

    Re: Lookup table help - multiple returns for one lookup value

    Where it says "Demand" just change that to the cell reference you want Radddogg

  23. #23
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Lookup table help - multiple returns for one lookup value

    Quote Originally Posted by radddogg View Post
    Thank you Sanram, however when using your formula the cells are populated by either "Complete" or "Demand", whereas the demand cells should display the first date.
    May be you are doing something wrong. See the image and attachment. It's producing dates and if there remain no available dates then it's showing Demand.


    Untitled-1.jpg

  24. #24
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2502
    Posts
    13,700

    Re: Lookup table help - multiple returns for one lookup value

    radddogg, you responded to Sanram:

    Thank you Sanram, however when using your formula the cells are populated by either "Complete" or "Demand", whereas the demand cells should display the first date.
    that's not what you indicated earlier.

    The supply table with the conditional formatting looks up against the demand sheet and if it finds a match I need it to populate from left to right to show the next expected delivery date.
    My proposal returns the next date.

  25. #25
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2502
    Posts
    13,700

    Re: Lookup table help - multiple returns for one lookup value

    'Contract' in 'demand' sheet are format SD#, MA#. There are also no dates in 'demand' to make the connection to the dates in 'orderbook'.

    'Contract' in 'orderbook' sheet are format SD, MA .... no numbers. There are dates in in 'orderbook'.

    There seems to be some missing information. Can you "read us in" on how to make relationship connections?

+ 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 returns error even when Lookup Value and Value on the table is the same
    By jcanlas in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-28-2015, 04:40 AM
  2. Lookup - Multiple returns
    By Clash in forum Excel General
    Replies: 10
    Last Post: 09-08-2011, 07:52 AM
  3. Lookup that returns data for multiple states
    By adhamija in forum Excel General
    Replies: 1
    Last Post: 03-10-2011, 05:59 PM
  4. lookup with two criteria and multiple returns
    By jimbob121 in forum Excel General
    Replies: 2
    Last Post: 10-05-2010, 09:59 AM
  5. One Index, Multiple Returns (one to many lookup)
    By brycewang in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-06-2010, 06:34 PM
  6. lookup with multiple possible returns
    By mheinmiller in forum Excel General
    Replies: 3
    Last Post: 03-31-2009, 01:35 PM
  7. [SOLVED] Lookup table returns #N/A
    By Kimberly Bassininsky in forum Excel General
    Replies: 2
    Last Post: 02-02-2006, 03:35 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