+ Reply to Thread
Results 1 to 4 of 4

VLOOKUP and INDEX

  1. #1
    Forum Contributor
    Join Date
    12-22-2004
    Location
    Kokomo, Indiana
    Posts
    236

    Question VLOOKUP and INDEX

    My system is using XP Pro with MS Excel 2007. I have spreadsheet I'm trying to use as a status sheet. See attached spreadsheet. There is a format control that has my projects listed. Once a project is selected my expectation is to have all (currently most) cells to auto populate. There is a project called Rehab Kirkuk Museum-CERP and when I select this everything populates exactly as I wanted it to. Next I select another project, like the first and all is fine. But when I select another different project than the Rehab Kirkuk Musem project nothing happens. Selecting a different project each time results in nothing. Only when I return to the Rehab Kirkuk Museum-CERP does everything populate again. In the next selection is fine as well, but after that nothing works correctly. What is wrong with my setup? I suspect my Index and Vlookup functions are somehow having difficulty with my data. How do I fix this? See attached spreadsheet.

    Tony
    Attached Files Attached Files

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: VLOOKUP and INDEX Problem

    You're using VLOOKUP whereas I suspect you want to use INDEX/MATCH where INDEX determines column to retrieve and MATCH the row...

    VLOOKUP can only look left to right, presently the below:

    =VLOOKUP($C$11,'ISOC-NK'!$A$2:$DN$31,1,TRUE)

    is looking up say:

    CERP Renovate Kirkuk Public Library

    against Column A on ISOC-NK sheet whereas this value actually resides in Col O on that sheet so perhaps you should be using:

    =INDEX('ISOC-NK!$A:$A,MATCH($C$11,'ISOC-NK!'$O:$O,0))

    The same logic can be applied elsewhere by modifying the INDEX range to be the appropriate column to be returned.

    NOTE: given the MATCH remains constant for ALL data being retrieved it makes sense to calculate once in one (hidden) cell and refer to that cell thereafter instead of repeatedly recalculating the same value... eg

    IU5: =MATCH($C$11,'ISOC-NK'!$O:$O,0)

    Then the earlier formula becomes

    =INDEX('ISOC-NK'!$A:$A,$IU$5)

    the reason it worked for some records is more by luck than judgement I'm afraid (down to Binary Search Algorithm in the VLOOKUP with TRUE range_lookup type)

  3. #3
    Forum Contributor
    Join Date
    12-22-2004
    Location
    Kokomo, Indiana
    Posts
    236

    Smile Re: VLOOKUP and INDEX Problem

    Thank you so much for the quick reply. I'm sitting in Kirkuk, Iraq trying to show a large spreadsheet of useful data into a single page. I'll be working your suggestions the remainder of this evening and tomorrow. I'll probably have another question or two before it done. Thanks again for your assitance.

  4. #4
    Forum Contributor
    Join Date
    12-22-2004
    Location
    Kokomo, Indiana
    Posts
    236

    Smile Re: VLOOKUP and INDEX Problem

    DonkeyOte, your suggestions worked like a champ. You've propelled me from having a hard to read spreadsheet into a useful tool. Thanks so much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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