+ Reply to Thread
Results 1 to 16 of 16

VLOOKUP Multiple Column Challenge

  1. #1
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    VLOOKUP Multiple Column Challenge

    I am familiar with using VLOOKUP and populating data into one column. What I don't understand is how to populate multiple columns.

    The attached demonstrates a user entering "3D2" into the search field. The desired effect is for the formula to return any matching data in column N from the data to the right.

    - How do I get the formula to return all seven columns of information pertaining to the search criteria ?

    - The final intended sheet layout (rows / columns) is the same as shown.

    - The search criteria will never exceed the first four characters on the left (i.e., 2E0G but not 2E0GW - refer N22 - )

    I've tried referring to examples on the Forum and from around the 'net' but I'm not having any success. Thank you for your assistance !
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: VLOOKUP Multiple Column Challenge

    Hi -

    Can you just use VLOOKUP like this:

    =VLOOKUP($G$11,$N$17:$T$15853,2)

    Paste this formula in cell F17. Copy across and change the last digit from 2 to 3 in cell G17 so it looks like this:

    =VLOOKUP($G$11,$N$17:$T$15853,3)

    Change the last digit to 4 in cell H17, 5 in I17, 6 in J17, and 7 in K17.

    Or am I not understanding what you're looking for?

    Hope this helps.
    ____________________________________________
    If this has solved your problem, please edit the thread title to add the word [SOLVED] at the beginning. You can do this by
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    If I have been particularly helpful, please "bump" my reputation by pressing the small star in the lower left corner of my post.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: VLOOKUP Multiple Column Challenge

    Im a bit confused by what you want?

    Which table is your data table
    Where do you want the answers?
    What do you mean by
    The search criteria will never exceed the first four characters on the left (i.e., 2E0G but not 2E0GW - refer N22 - )
    vlookup will search for whatever you enter, and will always only ever return ONE match
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: VLOOKUP Multiple Column Challenge

    Which table is your data table? The table on the right, in light grey.

    Where do you want the answers? Displayed in cells E17:K17 and below.

    What do you mean by: "The search criteria will never exceed the first four characters on the left (i.e., 2E0G but not 2E0GW - refer N22 - )
    vlookup will search for whatever you enter, and will always only ever return ONE match" ?

    - Be able to search just the first four characters (starting from the left side) residing in cells N17:N15853.

    - An example is always best for demonstration .... refer to Sheet 2 in the attached that explains what I mean ...


    Thank you for your help.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VLOOKUP Multiple Column Challenge

    Does this help?

    Please Login or Register  to view this content.

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: VLOOKUP Multiple Column Challenge

    I'm only getting the country displayed.

    I've seen from examples on the net / Forum where the formula can be pasted into E17 then copied down as many rows as needed in column E with
    incrementing row numbers :

    =VLOOKUP(LEFT($E$17,4),$N$17:$T$15853,{2,3,4,5,6,7},FALSE)
    =VLOOKUP(LEFT($E$18,4),$N$17:$T$15853,{2,3,4,5,6,7},FALSE)
    =VLOOKUP(LEFT($E$19,4),$N$17:$T$15853,{2,3,4,5,6,7},FALSE)

    This allows multiple returns on the search data if they exist. Using the last file attachment "VLOOKUP Multiple Columns 2.xlsx‎" Sheet #2, click on the blank rows in columns B, C or D and see how the formula increments.

    Isn't there a way to place the formula in the formula bar rather than referring to a Sub using VBA ?

    Thank you for your attention.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VLOOKUP Multiple Column Challenge

    There may be, but the only way I've been able to get the formula array for VLOOKUP too work is with VBA.

  8. #8
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: VLOOKUP Multiple Column Challenge

    Thank you for looking. Perhaps someone else ?

  9. #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: VLOOKUP Multiple Column Challenge

    Additional internet research reveals instead of VLOOKUP the formula should be using INDEX.

    An example of a resource I am referring to is attached. However, this formula generates an error message : "A value used in the formula is of the wrong data type." Curious it works in the example file but not in
    mine. I've checked and recheck my typing - hope I didn't overlook anything.

    Here is my attempt at the formula:

    Please Login or Register  to view this content.
    What am I doing wrong ?
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: VLOOKUP Multiple Column Challenge

    I have corrected that formula for you. You need a helper column there as you will write only 1st 3 letters. See the attachment.

    Attached Files Attached Files

  11. #11
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: VLOOKUP Multiple Column Challenge

    Sanram:

    Thank you so much for the assistance. I didn't realize until now, with over 15,000 data elements, how long it takes to "write" the search results
    to screen. Is there a means to make this faster (other than shortening my data list) ?

  12. #12
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: VLOOKUP Multiple Column Challenge

    You can use VBA to do so, which will take only few seconds to generate this.

  13. #13
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: VLOOKUP Multiple Column Challenge

    Would using VBA still allow me to use the cell G11 for entering the search criteria or would it be better to have a text box and a command button for the user to click on ?

  14. #14
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: VLOOKUP Multiple Column Challenge

    Would the VBA code go into the FORM or a Module ?

  15. #15
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: VLOOKUP Multiple Column Challenge

    Use the VBA on worksheet. Not on module or form. Use Worksheet_Change()

    See the attachment.
    Attached Files Attached Files
    Last edited by sanram; 08-08-2016 at 09:06 PM.

  16. #16
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: VLOOKUP Multiple Column Challenge

    WOW ! That is FAST !!! Thank you again for your help. You are a valuable resource.

+ 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. VLOOKUP challenge
    By cat3appr in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-08-2018, 05:47 PM
  2. [SOLVED] Excel VLOOKUP or DMAX Challenge
    By fmc031 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 07-18-2014, 08:53 AM
  3. Challenge Accepted?! IF,VLOOKUP,AVERAGEIF,.....
    By ZueriBoca in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-27-2013, 08:25 PM
  4. [SOLVED] Vlookup and If Statements Challenge
    By mrr2 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-22-2012, 01:04 PM
  5. Excel 2007 : Vlookup challenge
    By ngaisteve1 in forum Excel General
    Replies: 11
    Last Post: 04-23-2012, 04:11 AM
  6. [SOLVED] VLOOKUP Challenge
    By FSUMBA97 in forum Excel General
    Replies: 5
    Last Post: 07-25-2011, 02:43 PM
  7. VLookUp Challenge
    By wmgrubb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-05-2007, 06:28 PM

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