+ Reply to Thread
Results 1 to 8 of 8

Using VLOOKUP for more than 1 column

  1. #1
    Registered User
    Join Date
    09-11-2015
    Location
    VA
    MS-Off Ver
    2010
    Posts
    30

    Question Using VLOOKUP for more than 1 column

    So am trying to use VLOOKUP (or perhaps another way) where based on the value of 2 columns, I get a certain value in 2 other columns.


    For example:

    First Name Last Name City State



    So if I put in a City (Column C) and State (Column D) Combination, then I get the First (Column A) and Last Name (Column B) (both on another tab of the worksheet) of the Sales Person. But an error if the City and State are not valid.


    Any help would be greatly appreciated!

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Using VLOOKUP for more than 1 column

    I guess you will need VBA.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Cheers!
    Deep Dave

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Using VLOOKUP for more than 1 column

    No need for VBA, I think. Try this. if this ISN'T what you need, please upload a sample file.

    Make sure there is enough data to demonstrate your need. Make sure your desired results are shown, mock them up manually if necessary. Remember to remove ALL confidential information first!!!

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    The paperclip icon
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    09-11-2015
    Location
    VA
    MS-Off Ver
    2010
    Posts
    30

    Re: Using VLOOKUP for more than 1 column

    Thanks for the replies, this is what I'm trying to do!
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Using VLOOKUP for more than 1 column

    All you needed to do was make a tiny alteration to the formula that I gave you in the earlier post:

    =IFERROR(INDEX(Data!C$2:C$7,MATCH(1,INDEX((Data!$A$2:$A$77=Worksheet!$C2)*(Data!$B$2:$B$7=Worksheet!$D2),0),0)),"Error")
    Attached Files Attached Files

  6. #6
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Using VLOOKUP for more than 1 column

    or
    A2
    Please Login or Register  to view this content.
    =IFERROR(LOOKUP(2,1/((Data!$A$2:$A$7=$C2)*(Data!$B$2:$B$7=$D2)),Data!C$2:C$7),"error")
    Try this and copy across
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  7. #7
    Registered User
    Join Date
    09-11-2015
    Location
    VA
    MS-Off Ver
    2010
    Posts
    30

    Re: Using VLOOKUP for more than 1 column

    Thanks to both Glenn and Siva!!

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Using VLOOKUP for more than 1 column

    you're welcome ... and thanks for the rep.

+ 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. [SOLVED] VLOOKUP returns column where column header matches another cell
    By bridge4444 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-10-2014, 11:23 AM
  3. Replies: 1
    Last Post: 02-20-2014, 08:42 AM
  4. Replies: 12
    Last Post: 01-28-2014, 12:36 PM
  5. [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
  6. [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
  7. Macro for Vlookup copy from one column to next one and change column reference
    By RajivShrivastav in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2010, 06:39 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