+ Reply to Thread
Results 1 to 16 of 16

Look up column A based on column B, C, and D data

  1. #1
    Registered User
    Join Date
    03-05-2019
    Location
    Fort Washington, PA
    MS-Off Ver
    2019
    Posts
    9

    Look up column A based on column B, C, and D data

    Hello,

    I currently have two tabs, one tab is used as a user input page while data are in tab 2.
    In tab 2 I have column A as parts, and column B, C, and D, as the dimensions of the part (width, length, depth).
    On tab 1, I want the user to put in a width, depth, and height, and output the recommended part(s). The dimensions can be approximate and rounded.
    I did
    =IF(VLOOKUP(B2,CARTONS!B:B,2,TRUE),CARTONS!A:A,"No Components Availiable")
    but got a #N/A as the output.

    Please help, what am I doing wrong?

    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Look up column A based on column B, C, and D data

    please attach a sample file with typical data and enter expected result [manually].
    It's difficult to help you without seeing actual sheet.
    1. Click on the * Add Reputation if you think this helped you
    2. Mark your thread as SOLVED when question is resolved

    Modytrane

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Look up column A based on column B, C, and D data

    for one, this part CARTONS!B:B,2,TRUE is saying that you look at cartons tab in col B and then GO OVER to col C BUT you only list col B in as the distance over, in other words this needs to be CARTONS!B:C,2,TRUE
    then the TRUE means that you are looking for an approximate match, not an exact match, is that what you want?
    To go deeper you might need to post a sample workbook with the desired results. Hope that helps.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Registered User
    Join Date
    03-05-2019
    Location
    Fort Washington, PA
    MS-Off Ver
    2019
    Posts
    9

    Re: Look up column A based on column B, C, and D data

    I've attached the file. Basically I need it to look up a drawing based on the dimensions given. The input width, depth and height doesn't have to be exact, and can be off by 0.015

    Thanks again guys!
    Attached Files Attached Files

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Look up column A based on column B, C, and D data

    this appears to work...
    =INDEX(CARTONS!$A$2:$A$6,MATCH('COMPONENT LOOKUP'!B2,CARTONS!$B$2:$B$6,0),MATCH('COMPONENT LOOKUP'!B3,CARTONS!$C$2:$C$6,0),MATCH('COMPONENT LOOKUP'!B4,CARTONS!$D$2:$D$6,0))

  6. #6
    Registered User
    Join Date
    03-05-2019
    Location
    Fort Washington, PA
    MS-Off Ver
    2019
    Posts
    9

    Re: Look up column A based on column B, C, and D data

    It does! Appreciate it Sambo kid. Is it possible to make it consider B3 and B4? For example, if they didn't put anything in B3 or B4, it wouldn't matter, but if the user did, it'll refine the search. This will be in case there is two of similar width, or similar depth (so they use height as well).
    Or if it can be done, can it be made so that the order don't matter in case the user put width as depth, and depth as width?

    Thanks,

  7. #7
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Look up column A based on column B, C, and D data

    this should take care of it if you have width, but no depth, width and depth but no height or if you have all three.
    =IFERROR(INDEX(CARTONS!$A$2:$A$6,MATCH(B2,CARTONS!$B$2:$B$6,0)),IFERROR(INDEX(CARTONS!$A$2:$A$6,MATCH(B3,CARTONS!$C$2:$C$6,0)),NDEX(CARTONS!$A$2:$A$6,MATCH(B4,CARTONS!$D$2:$D$6,0))))

  8. #8
    Registered User
    Join Date
    03-05-2019
    Location
    Fort Washington, PA
    MS-Off Ver
    2019
    Posts
    9

    Re: Look up column A based on column B, C, and D data

    Thanks for the quick response! I tried it but when the first data is similar, it doesn't show up the correct answer. I've attached an updated spreadsheet with added data with similar width, and different length and depth.

    Thanks,
    Attached Files Attached Files

  9. #9
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Look up column A based on column B, C, and D data

    make the zeros ones instead...
    =IFERROR(INDEX(CARTONS!$A$2:$A$10,MATCH(B2,CARTONS!$B$2:$B$10,1)),IFERROR(INDEX(CARTONS!$A$2:$A$10,MATCH(B3,CARTONS!$C$2:$C$10,1)),INDEX(CARTONS!$A$2:$A$10,MATCH(B4,CARTONS!$D$2:$D$10,1))))
    this will allow approximate matches.

  10. #10
    Registered User
    Join Date
    03-05-2019
    Location
    Fort Washington, PA
    MS-Off Ver
    2019
    Posts
    9

    Re: Look up column A based on column B, C, and D data

    ohh gotcha.
    But now it doesn't show C-1509 when I put in 3.328, 1.75, 1.75.

  11. #11
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Look up column A based on column B, C, and D data

    it does on mine, see the attached workbook, cell B11.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    03-05-2019
    Location
    Fort Washington, PA
    MS-Off Ver
    2019
    Posts
    9

    Re: Look up column A based on column B, C, and D data

    Your attached file don't have the extra data. It didn't work when I try looking up other parts.
    Attached Files Attached Files

  13. #13
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Look up column A based on column B, C, and D data

    this is the only one I see that can work if you have one, two or three measures and it works only if there is an exact match...
    =IFERROR(INDEX(CARTONS!$A:$A,MATCH(B2,CARTONS!$B:$B,0)),IFERROR(INDEX(CARTONS!$A:$A,MATCH(B3,CARTONS!$C:$C,0)),NDEX(CARTONS!$A:$A,MATCH(B4,CARTONS!$D:$D,0))))
    Maybe someone else can figure out a way to give you approximate matches based on one, two or three criteria.

  14. #14
    Registered User
    Join Date
    03-05-2019
    Location
    Fort Washington, PA
    MS-Off Ver
    2019
    Posts
    9

    Re: Look up column A based on column B, C, and D data

    thanks for your help Sambo Kid! appreciate the help!

    Can anyone else help with what I'm trying to do?

  15. #15
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Look up column A based on column B, C, and D data

    Here's a simple macro that looks up based on three dimensions.
    See attached file.

    Does this work for you?

    Please Login or Register  to view this content.
    Attached Files Attached Files

  16. #16
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Look up column A based on column B, C, and D data

    If you need to match dimensions approximately, then you can define the range.
    For example, you can say that if the dimensions are within 5% it's considered a match.
    Compare statements in the macro can be modified to add that.

+ 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] VB Code to copy paste data from column to another column based on content of cell
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-28-2019, 08:50 PM
  2. Auto-adjust # of rows in a column that have a formula based on adjacent column data?
    By Norcal1 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 05-31-2018, 02:03 PM
  3. Replies: 5
    Last Post: 05-14-2014, 08:35 AM
  4. Replies: 3
    Last Post: 03-22-2014, 08:35 AM
  5. Replies: 9
    Last Post: 06-08-2012, 06:22 PM
  6. Replies: 3
    Last Post: 02-08-2010, 06:18 PM
  7. Replies: 2
    Last Post: 03-16-2009, 12:26 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