+ Reply to Thread
Results 1 to 11 of 11

Trouble with Complicated VLookup

  1. #1
    Registered User
    Join Date
    03-20-2014
    Location
    Waltham
    MS-Off Ver
    Excel 2003
    Posts
    6

    Trouble with Complicated VLookup

    Hi Everyone,

    I'm attempting to write a vlookup (or any variation) formula for the information attached. This excel spreadsheet contains a little over 12,000 rows.

    I would like 'DOT Code' to be the lookup value and for all the information contained immediately to the right to populate. This can be accomplished with a vlookup for each individual value (although I'm sure there must be an easier way, if anyone can provide insight as to how I can write one formula for the entire row).

    However, my main problem lies with the information just to the left of the DOT Code info. Besides being to the left of the lookup value, it's at the top of each section. How can I get each one of those DOT codes to populate a spreadsheet with its respective information.

    For instance, if I were to type in "221.467-010" I want it to pull the string of information to the right and left of the call. The information contained to the right and within the same row, as I said, can be accomplished via a vlookup. But the information to the left is, not only to the left, but up 4 rows, e.g. 43-5111 | Weighers, Measurers | (4.0 to < 6.0) | 69,870 | 33.

    To be clear, if I were to type in another DOT, such as '221.482-018', all the information to the left would be the same the same as the DOT code before this because they are in the same category, but the info to the right would change.

    There must be some sort of nested Vlookup. I'm just having difficulty getting it to work.

    Lastly, if there were some way to get all that to work, I'd like the numbers chart to the right to populate as well.

    Any and all help would be very much appreciated! More than happy to provide further information. Thanks so much.

    ExcelScreenshot.png

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Trouble with Complicated VLookup

    Hi, and welcome to the forum.

    Please attach the workbook, pictures are rarely much use - see guidance in the rules area.

    Make sure there is just enough data to make it clear what is needed. 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 demonstrated, mock them up manually if needed. Remember to desensitize the data.

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

    View Pic
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-20-2014
    Location
    Waltham
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Trouble with Complicated VLookup

    Alright, I attached the workbook with a before and after sheets.
    Attached Images Attached Images

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Trouble with Complicated VLookup

    doesnt look like a workbook ......... still seems to be an image
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    03-20-2014
    Location
    Waltham
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Trouble with Complicated VLookup

    Sorry about that! I'm not sure what happened.
    Attached Files Attached Files

  6. #6
    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,959

    Re: Trouble with Complicated VLookup

    This will work....
    =INDEX('O-NET-SOC 2010 Occupation Listi'!$A:$AW,MATCH($H8,'O-NET-SOC 2010 Occupation Listi'!$H:$H,0),MATCH(A$6,'O-NET-SOC 2010 Occupation Listi'!$A$6:$AW$6,0))
    However, in the columns where you have no entries for the DOT code, this will return 0
    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

  7. #7
    Registered User
    Join Date
    03-20-2014
    Location
    Waltham
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Trouble with Complicated VLookup

    Thanks so much for your help. I pasted that formula into cell A8 and got the correct result. However, I'm not sure where to go from here, as I'm not to familiar with match and index functions. Am I supposed to set up each individual cell with minor tweaks of that formula? Or is there a faster way to do the whole thing?

  8. #8
    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,959

    Re: Trouble with Complicated VLookup

    Just copy it down as-is, it should not need any adjustments

  9. #9
    Registered User
    Join Date
    03-20-2014
    Location
    Waltham
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Trouble with Complicated VLookup

    Wow, that's pretty impressive. I definitely need to learn how those functions work. Seems to be way faster than any VLookup.

    So the information to the right seems to work great. But, except for the top row, I'm getting all 0's for the information on the left.

  10. #10
    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,959

    Re: Trouble with Complicated VLookup

    INDEX/MATCH works pretty much the same as vlookup(), but vlookup() has the disadvantage of (generally) not being able to return values to the left of the criteria column (DOT column in your case)

    So the information to the right seems to work great. But, except for the top row, I'm getting all 0's for the information on the left.
    yes, I already commented onthat in post # 6

    However, in the columns where you have no entries for the DOT code, this will return 0
    In your file, most of the data in columns A:G is empty, so if you look at the 2nd entry on "after"....209.587-010
    That can be found in row 1740, but A1740:G1740 is blank. I understand you were expecting to have the vvalue in A1733, but the value you are looking for is not in that row, is is (in this case) 7 rows up...in others it could be
    33 or more rows up.

  11. #11
    Registered User
    Join Date
    03-20-2014
    Location
    Waltham
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Trouble with Complicated VLookup

    Thanks for all your help! Do you have any ideas as to how to get this last part to work? Is there any way to get that data into those cells without ruining the visual aesthetics? Like is my only option to write those cells in white font?

+ 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] Complicated vlookup ?? HELP!
    By gillas01 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-07-2014, 10:13 AM
  2. Vlookup but a little more complicated
    By dinker454 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-29-2013, 04:20 PM
  3. Performing a very complicated VLOOKUP
    By akhtarn11 in forum Excel General
    Replies: 1
    Last Post: 04-28-2011, 12:49 PM
  4. Trouble adding an IF to a fairly complicated formula
    By AllenMead in forum Excel General
    Replies: 1
    Last Post: 09-29-2010, 07:55 AM
  5. Vlookup, but more complicated.
    By BBJAY in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 02-16-2009, 02:39 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