+ Reply to Thread
Results 1 to 11 of 11

vlookup using 2 columns

  1. #1
    Registered User
    Join Date
    12-07-2009
    Location
    Fiji
    MS-Off Ver
    Excel 2007
    Posts
    13

    Question vlookup using 2 columns

    Hi,

    I have 2 sheets in a work book. One sheet contains the master list and the other Sheet is the Data Entry sheet.
    However I need to look at 2 colums to populate the item description.
    Stocktake.xlsx. I have attached the sample file for reference.
    There are 2 input fields - IniqueItemCode and EAN
    After input the item description should appear. There are cases where we have both values in Col A and Col B
    and the Item description will Populate. Please advsie

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,373

    Re: vlookup using 2 columns

    I'm confused when you need both columns (A and B) as criteria, but I see your file you have several blanks on column B, can you explain it?

  3. #3
    Registered User
    Join Date
    12-07-2009
    Location
    Fiji
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: vlookup using 2 columns

    There are some blanks. Not all items have barcodes so the alternative is the product code. If either is entered. the Item Discripton is populated

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: vlookup using 2 columns

    Which version of Excel are you using? Your profile says 2007, but you have attached an .xlsx file.

    You can nest two VLOOKUPS within an IFNA function:

    =IFNA(VLOOKUP(one),VLOOKUP(two))

    In C2 copied down:

    =IFNA(VLOOKUP(A2,MasterList!$A$2:$C$15,3,0),VLOOKUP(B2,MasterList!$B$2:$C$15,2,0))
    Last edited by AliGW; 07-26-2018 at 02:04 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,373

    Re: vlookup using 2 columns

    Put this on L6

    =IFERROR(INDEX(C2:C15,CHOOSE((L2="")+1,MATCH(L2,A2:A15,0),MATCH(L3,B2:B15,0))),"")
    Attached Files Attached Files
    Last edited by azumi; 07-26-2018 at 02:57 AM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: vlookup using 2 columns

    If the output needs to be based on L2 and L3, then this:

    =IFNA(VLOOKUP(L2,MasterList!$A$2:$C$15,3,0),VLOOKUP(L3,MasterList!$B$2:$C$15,2,0))

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: vlookup using 2 columns

    Quote Originally Posted by AliGW View Post
    Which version of Excel are you using? Your profile says 2007, but you have attached an .xlsx file.
    Excel 2007 has xlsx extension vs. Excel 2003 with xls extension
    and IFNA() (2013) doesn't work on Excel 2007
    Last edited by sandy666; 07-26-2018 at 04:38 AM.

  8. #8
    Forum Contributor
    Join Date
    10-30-2003
    Location
    Singapore
    MS-Off Ver
    Excel 2019
    Posts
    197

    Re: vlookup using 2 columns

    Or,

    In L6 :

    =INDEX(C2:C15,IF(L2<>"",MATCH(L2,A2:A15,0),MATCH(L3,B2:B15,0)))

    Regards
    Bosco

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: vlookup using 2 columns

    OK - for Excel 2007, then (untested):

    =IF(ISNA(VLOOKUP(L2,MasterList!$A$2:$C$15,3,0),VLOOKUP(L3,MasterList!$B$2:$C$15,2,0)))

  10. #10
    Registered User
    Join Date
    12-07-2009
    Location
    Fiji
    MS-Off Ver
    Excel 2007
    Posts
    13

    (SOLVED)Re: vlookup using 2 columns

    Thanks you all I have to use formulas and it worked

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: vlookup using 2 columns

    You’re welcome!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

    EDIT: I've done it for you.
    Last edited by AliGW; 07-27-2018 at 03:03 AM.

+ 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] Sum multiple columns using a VLOOKUP only if the columns have a value
    By pareid in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-04-2016, 09:29 AM
  2. [SOLVED] Nested Vlookup, or Vlookup that looks at two columns, not just one?
    By FirestarZA in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-24-2014, 08:18 AM
  3. vlookup to sum different columns....BUT....
    By mart biesheuvel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-04-2013, 09:58 PM
  4. vlookup in two or more columns
    By Jocote46 in forum Excel General
    Replies: 4
    Last Post: 07-14-2011, 10:57 AM
  5. Can vlookup two columns instead of one?
    By AdamParker in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-22-2008, 02:27 PM
  6. [SOLVED] VLookup against one of two columns
    By Mark in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-13-2006, 12:40 PM
  7. =vlookup on 2 columns
    By Mike in forum Excel General
    Replies: 4
    Last Post: 02-11-2006, 07:00 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