+ Reply to Thread
Results 1 to 6 of 6

Looking up values using MATCH, then return 1 of 3 different results

  1. #1
    Forum Contributor
    Join Date
    11-05-2006
    Posts
    123

    Looking up values using MATCH, then return 1 of 3 different results

    In "export.xls", column AI will sometimes have a value of "360", and sometimes not.
    If it does, we are then interested column K of the same row, the "design_number".

    In "360 DATABASE.xls", column A will have a list of "design_numbers" (with dashes removed).

    Some design numbers from "export" will be found in "360 DATABASE", while some will not. This can be found easily enough using VLOOKUP.

    My goal is to add a column in "export" next to column AI with the header "Die on-hand?". I want each row below this header to show 1 of 3 possibilities:
    1. "360 die on-hand" if found in the "360 DATABASE".
    2. "please add design" if the design_number is NOT found in "360 DATABASE", but column AI of "export" has a value of "360".
    3. Nothing (blank), if the value "360" was not found in column AI of "export" for this row.

    I have tried several very amateurish times to do this with simple IF and VLOOKUP functions, but I cannot get the result I am wanting. I need a macro that can perform this for me. The example files include 3-4 instances of possibility # 2 above, and many more of possiblities #1 and #3.

    Many thanks to anyone who is willing to provide code. I not only want to use it, but to learn from it.
    Attached Files Attached Files
    Last edited by Wedge120; 09-02-2010 at 05:00 PM. Reason: make thread topic clearer for members

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Use VLOOKUP then separate into 3 possible results

    Hi

    This can be done by a formula - but both workbooks will have to be open at the same time.

    Export!AJ2:
    Please Login or Register  to view this content.
    You will have to adjust the file names.

    rylo

  3. #3
    Forum Contributor
    Join Date
    11-05-2006
    Posts
    123

    Re: Use VLOOKUP then separate into 3 possible results

    Why the
    Please Login or Register  to view this content.
    in
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Use VLOOKUP then separate into 3 possible results

    Hi

    Thats just how my PC interprets your file names when I open them from this site. I didn't bother to save them and correct the names, just let them stand and advised you to correct the file names in the formulas.

    rylo

  5. #5
    Forum Contributor
    Join Date
    11-05-2006
    Posts
    123

    Re: Use VLOOKUP then separate into 3 possible results

    Your formula doesn't rely on the "360 DATABASE" being sorted in ascending order does it? I only ask because I want to know if I should include it in the macro.


    Ah I see. The third argument in match is "0", so in this case, the array doesn't require sorting.

    Thank you for your help.
    Last edited by Wedge120; 09-02-2010 at 04:51 PM.

  6. #6
    Forum Contributor
    Join Date
    11-05-2006
    Posts
    123

    Re: Looking up values using MATCH, then return 1 of 3 different results

    Can anyone show an example of how to create the same formula using line continuation so that I can fit the entire formula on my screen? I don't like having to scroll right in order to see the code.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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