+ Reply to Thread
Results 1 to 5 of 5

Vlookup Ref error

  1. #1
    Registered User
    Join Date
    11-07-2007
    Location
    In the frozen tundra of the northern US *waaah*... why didn't I move to So.Cali. when I had the chance?!?!?!
    Posts
    5

    Vlookup Ref error

    I am just getting into Excel programming.

    I've attached my two sheet workbook with a sample. The first sheet (MBIR-Nov) has the cell with the vlookup error in it. The second sheet holds the data I'm trying to get the first sheet to reference.

    And if you want to take it a step further, what I'm REALLY trying to do is the following:

    Divide the number of complaints by the total number of products shipped for that month to find the percentage of "problem products". I want to do this by dividing the value in the cell directly above the vlookup-error-cell by the value derived from the VLookup, which needs to check both month AND year (currently only looking at month) so that I end up with a percentage.

    Am I crazy or is this do-able?
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-25-2008
    Location
    The Netherlands
    MS-Off Ver
    2002, 2003, 2007
    Posts
    94
    hi jessa_lee,

    I had a look at your file and the problem seems to be the caused by the following.

    Your formula (=VLOOKUP(MyMonth,PackMonth,4,FALSE))
    tells excel to find MyMonth in the first column of the array called PackMonth, and then return the matching value of the 4th column of the array.

    However, your PackMonth name definition is set to:
    ='F:\Application\Current\[2007_Log.xls]PackNum'!$B$2:$B$120

    This array has only one column, so the 4th column cannot be found by Vlookup, returning #REF.
    J.

  3. #3
    Registered User
    Join Date
    11-07-2007
    Location
    In the frozen tundra of the northern US *waaah*... why didn't I move to So.Cali. when I had the chance?!?!?!
    Posts
    5
    Thanks for your tip. I changed my range from the B column only to include cells A1:H120. When I made that change, I noticed that now my error is an "N/A" error instead of a "Ref" error.

    Any ideas on what I need to do now?

  4. #4
    Registered User
    Join Date
    11-07-2007
    Location
    In the frozen tundra of the northern US *waaah*... why didn't I move to So.Cali. when I had the chance?!?!?!
    Posts
    5
    Thanks - that fixed my first problem.

    Now how do I make it able to look up the year, then the month, then return the result into the field?

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    You're now looking in column A of the second sheet for the month number (which is in column B). Based on what you said you are looking for (yr and month) I suggest you combine columns A and B in PackNum (I did it with a space between year and month) and then you can concatenate your year and month in your lookup with this formula
    Please Login or Register  to view this content.
    I attached your modified workbook.

    ChemistB
    Attached Files Attached Files

+ 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