+ Reply to Thread
Results 1 to 7 of 7

Incorrect Result WIth Vlookup

  1. #1
    Forum Contributor
    Join Date
    06-15-2009
    Location
    Ontario, canada
    MS-Off Ver
    Office 365
    Posts
    371

    Incorrect Result WIth Vlookup

    Consider this small database:

    312.jpg

    I am not getting the results expected with this formula in my code:

    Please Login or Register  to view this content.
    This code populates column DE of a secondary database with the calculated value from the formula applied.

    For example ... if the value in R20 is HPL1, the expected result in DE20 would be "Not staffed.". If the value in R21 is WPL1, the expected result in DE21 would be "Sarah".

    What I am getting, regardless of the value in R, is always "Not staffed".

    Can anyone advise where I might be going wrong?

    Jenn

    Note: The 1st If condition is redundant. The value will never equal "CUPE", but not sure how to get rid of it without screwing up something more than it already is.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,457

    Re: Incorrect Result WIth Vlookup

    A sample workbook would be more effective than a picture ...
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    06-15-2009
    Location
    Ontario, canada
    MS-Off Ver
    Office 365
    Posts
    371

    Re: Incorrect Result WIth Vlookup

    Thanks for the reply TMShucks ...

    Are you suggesting attaching an .xls file? My application is rather large comprised of supporting reference databases full of confidential info. Not sure how easily I can adapt something that would simulate the entire application in just a sample.

    Is there anything in particular I can answer that might help additionally?

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Incorrect Result WIth Vlookup

    Hi

    Maybe something to do with the fixed reference to R2???

    rylo

  5. #5
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Incorrect Result WIth Vlookup

    Hi

    Maybe something to do with the fixed reference to R2???

    rylo

  6. #6
    Forum Contributor
    Join Date
    06-15-2009
    Location
    Ontario, canada
    MS-Off Ver
    Office 365
    Posts
    371

    Re: Incorrect Result WIth Vlookup

    Hy Rylo ... thanks for your reply.

    You may be right. I changed the formula to
    Please Login or Register  to view this content.
    which is a bit more simple. Still similar results.

    I'm not sure what other options are available ... I did try substituting "R2" with ""R"" & RowNo
    Please Login or Register  to view this content.
    but just got an error.

    Jenn

  7. #7
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Incorrect Result WIth Vlookup

    Jenn

    how about
    Please Login or Register  to view this content.
    rylo

+ 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