Windows EXCEL-Problem: Vlookup function doesnt work :S

Discussion in 'Software' started by Mr-IK, 3 May 2010.

  1. Mr-IK

    Mr-IK Minimodder

    Joined:
    12 Mar 2007
    Posts:
    304
    Likes Received:
    0
    Hi all :)

    Ill try to keep this short, and easy to understand. I've reached a dead-end and cannot figure out how to make this work.

    I'm trying to make a way of browsing my companies supplies of various IT-related equipment.

    This is my design:

    B14 - Drop-down menu where you select a category based in a list made in sheet1 (Works!)
    D14 - Drop-down menu where you select the model fx. Cellphones is chosen in B14, you can choose HTC Touch Diamond here. (Works!)
    F14 - Status field based on a Vlookup function. The amount of the selected model will appear here.

    Further down sheet 1 (not supposed to be browsed, its just data) i have my data. Its 3 columns (Model - Amount - Comments) and 20 rows, just to make sure i have enough rows. Here's a picture, its easier to understand :p:
    [​IMG]

    The problem is with the F14 Cell, (the "Status" cell). Here's the formula used.
    Code:
    =(HVIS($D$14="";0;LOPSLAG($D$14;B110:D971;1)))
    I know its supposed to work because it does in another document i have. Only it doesn't here. When i choose fx. a specific phone it will return the header of a category 403 cells further down, and not the amount in the cell right after... I've tried to change all parameters in the function, but nothing makes it right.

    It also works if i sort/arrange all the data in the matrix alphabetically, but then the system on the picture doesn't work cause its all just in one big list, and i REALLY need to have the categories.

    Hope someone understands this problem, and can help :)

    Thanks in advance :thumb:
     
  2. tripwired

    tripwired Deploying Surprise in 3... 2...1...

    Joined:
    12 Feb 2009
    Posts:
    293
    Likes Received:
    20
    I *think* because the list is not alphabetically sorted you need to change the '1' at the end of the formula to '0'.

    Code:
    =(HVIS($D$14="";0;LOPSLAG($D$14;B110:D971;1)))
    should be

    Code:
    =(HVIS($D$14="";0;LOPSLAG($D$14;B110:D971;0)))
    does that work?
     
  3. Mr-IK

    Mr-IK Minimodder

    Joined:
    12 Mar 2007
    Posts:
    304
    Likes Received:
    0
    Thank you for the answer!

    I've tried all the petty changes just to make sure it wasnt something simple. As i mentioned earlier, i know it works if i sort the data in the matrix alphabetically, but then i wouldnt be able to add new stuff under certain categories.

    It seems like my only option is to change the list and make it alphabetically, but that would make the system jsut as complicated/not cool as the old one im using :grr:
     

Share This Page