+ Reply to Thread
Results 1 to 11 of 11

2 Column VLookup

  1. #1
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    2 Column VLookup

    Hello All Again,

    The below code works perfect for one column, but I have another column which needs to be checked, and the corresponding value returned. Any ideas or help would be greatly appreciated.

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: 2 Column VLookup

    When you say another column, are you referring to the result found in a column other than 2 as shown in your formula or do you mean you want the vlookup to seek the criteria in a column other than Column S. And are you looking for the results to be returned to column N as you currently have.Specifics are important to addressing your issue. To many variables here!
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: 2 Column VLookup

    Hello-currently the code looks at Column E in "CallData" checks for a match in "Callagentname" and returns the value if matched. I need it to also look in Column K in "CallData". Hope this makes sense.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: 2 Column VLookup

    If it finds a match for column E and finds a match for column K, which value to return? E or K?

  5. #5
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: 2 Column VLookup

    Basically, there would never be a valid value in both columns in the same row. Hope this makes sense. Thanks.

  6. #6
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: 2 Column VLookup

    This is crude I know, but this is the basic concept:

    Please Login or Register  to view this content.

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: 2 Column VLookup

    In that case, insert a line of code below the line

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    and see if that works for you.

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: 2 Column VLookup

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  9. #9
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: 2 Column VLookup

    When I added that line, it bypasses the first line of code, and only applies the 2nd Vlookup.

    Please Login or Register  to view this content.

  10. #10
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: 2 Column VLookup

    Try this:

    Please Login or Register  to view this content.
    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  11. #11
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    263

    Re: 2 Column VLookup

    ABOUSETTA!!!!! YES YES YES!!! You are BRILLIANT MY FRIEND!!! Thank-you so much!!! Thanks for everyone else's help as well.

+ 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] Macro to Insert column and include a VLOOKUP array for entire column
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-29-2014, 06:28 PM
  2. Replies: 1
    Last Post: 02-20-2014, 08:42 AM
  3. Replies: 12
    Last Post: 01-28-2014, 12:36 PM
  4. [SOLVED] Vlookup with column name instead of col_index_name(3rd Section of Vlookup formula)
    By akulka58 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-21-2014, 10:42 AM
  5. [SOLVED] Copy data from column to other sheets, based upon vlookup/criteria on column a
    By jedemeyer1 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-27-2013, 04:01 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