+ Reply to Thread
Results 1 to 4 of 4

VLOOKUP returning incorrect results

  1. #1
    Registered User
    Join Date
    11-01-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    45

    VLOOKUP returning incorrect results

    Hi, I am encountering some problems with a vlookup formula where I am trying to join data based on a common field in two worksheets.

    If you look at the attached image, you will see that I am trying to show the date of the last action in the report worksheet by looking up the client ID from the report worksheet in the action worksheet.

    Excel-VLOOKUP.jpg

    The formula I have used is
    =VLOOKUP(A2,Action!A:C,3,TRUE)

    This works for the first row in the report worksheet, where it correctly displays the 01 May 2013 as that is the corresponding date for that client ID in the action worksheet.

    The problem is that not all client IDs will have an action, and where this is the case (in rows 3,4,5,7,8,9 & 10) it is incorrectly showing the date from the last result it can find from the rows above.

    Also, some clients may have more than 1 action, so how do I show the earliest date when this is the case? E.g. client ID 2958 has 2 actions in the action worksheet, but the date shown in the report worksheet is the date furthest in the future - I want the earliest date.

    A) How do I stop dates being shown incorrectly?
    B) How do I show the earliest action date if there are 2 or more dates for a client ID in the action worksheet (e.g. rows 3 & 4)?

    Many thanks in advance for any help with this!
    Steve

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: VLOOKUP returning incorrect results

    Change true to false

  3. #3
    Registered User
    Join Date
    11-01-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: VLOOKUP returning incorrect results

    Fantastic, that has done the trick for question A - thanks so much.

    Does anyone have any idea regarding B, and how I show the earliest action date if there are 2 or more dates for a client ID in the action worksheet (e.g. rows 3 & 4)?

    Cheers,
    Steve

  4. #4
    Registered User
    Join Date
    11-01-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: VLOOKUP returning incorrect results

    Sorry, deleting post as my reply went up twice!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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