+ Reply to Thread
Results 1 to 9 of 9

vlookup issue

  1. #1
    Registered User
    Join Date
    01-29-2011
    Location
    Upland, California
    MS-Off Ver
    Office 365
    Posts
    32

    Thumbs up vlookup issue

    I'm trying to use vlookup on two sets of data where my lookup value is in column "A" of the first data set below. My table array is column "A" through "C" in the second data set below, where column index number = 3, which is column "C", the "date" column in the second data set. When I run this vlookup I get the result in column "C", the "Scheduled appt" column in the first data set, which is incorrect. My return is a duplication of the column "C" data of the first row of the second data set "8/19/2010".

    What I need is the return to give me each of the two dates from the second data set as in the third data set below which I have faked so you can see what I'm trying to accomplish.

    Any help would be GREATLY appreciated as I'm at my wits end on trying to find a solution for this. I'm still too new to figure this one out by myself.

    My actual data sets contain over 50 thousand records, some of which will have, as in the examples below, clients with multiple records, of which I need to return each individual date from the second data set that relates to the "ActRecordid" of the first data set.
    A B C D
    ActRecordid ActionCode Result scheduled appt
    019P91KITX INCALL*** APPOINT** 8/19/2010
    019P91KITX INCALL*** APPOINT** 8/19/2010
    -------------------------------------------------------------------------------------------------------------------
    A B C D
    recordid act_code Date result_code
    019P91KITX APPOINT** 8/19/2010 0:00 SHOWNOSALE
    019P91KITX APPOINT** 8/17/2010 0:00 CANCEL***
    ---------------------------------------------------------------------------------------------------------------------
    A B C D
    ActRecordid ActionCode Result scheduled appt
    019P91KITX INCALL APPOINT 8/19/2010
    019P91KITX INCALL APPOINT 8/17/2010

    Thank you for your help!
    Anthony

    *
    Last edited by ascottbag; 02-13-2011 at 03:54 PM. Reason: solved

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: vlookup issue

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  3. #3
    Registered User
    Join Date
    01-29-2011
    Location
    Upland, California
    MS-Off Ver
    Office 365
    Posts
    32

    Question How to reconcile two data sets

    I'm trying to use vlookup on two sets of data where my lookup value is in column "A" of the first data set below. My table array is column "A" through "C" in the second data set below, where column index number = 3, which is column "C", the "date" column in the second data set. When I run this vlookup I get the result in column "C", the "Scheduled appt" column in the first data set, which is incorrect. My return is a duplication of the column "C" data of the first row of the second data set "8/19/2010".

    What I need is the return to give me each of the two dates from the second data set as in the third data set below which I have faked so you can see what I'm trying to accomplish.

    Any help would be GREATLY appreciated as I'm at my wits end on trying to find a solution for this. I'm still too new to figure this one out by myself.

    My actual data sets contain over 50 thousand records, some of which will have, as in the examples below, clients with multiple records, of which I need to return each individual date from the second data set that relates to the "ActRecordid" of the first data set.

    I have attached a sample of the data.

    A B C D
    ActRecordid ActionCode Result scheduled appt
    019P91KITX INCALL*** APPOINT** 8/19/2010
    019P91KITX INCALL*** APPOINT** 8/19/2010
    -------------------------------------------------------------------------------------------------------------------
    A B C D
    recordid act_code Date result_code
    019P91KITX APPOINT** 8/19/2010 0:00 SHOWNOSALE
    019P91KITX APPOINT** 8/17/2010 0:00 CANCEL***
    ---------------------------------------------------------------------------------------------------------------------
    A B C D
    ActRecordid ActionCode Result scheduled appt
    019P91KITX INCALL APPOINT 8/19/2010
    019P91KITX INCALL APPOINT 8/17/2010

    Thank you for your help!
    Anthony
    Attached Files Attached Files

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: vlookup issue

    firstly the syntax of your vlookup is wrong
    =VLOOKUP($A$3:$A$11,'lookup data set'!$A$2:$C$10,3,FALSE)
    the first bit should be thing to lookup it cant be a range $A$3:$A$11
    i've reproduced the results you wanted see helpers in yellow
    Attached Files Attached Files
    Last edited by martindwilson; 02-13-2011 at 03:22 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    01-29-2011
    Location
    Upland, California
    MS-Off Ver
    Office 365
    Posts
    32

    Re: vlookup issue

    Martin,

    How should the vlookup be written then? The way that I have written the vlookup is how I've always done it. The issue I'm having as you can see from the attached file sample is that my data in column "A" of the main data source tab can contain multiple client ID's that need to return individual lookup data from column "c" of the lookup tab.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: vlookup issue

    fyi the vlookup should just be
    VLOOKUP(A3,'lookup data set'!$A$2:$C$10,3,FALSE)
    dragged down will change to
    VLOOKUP(A4,'lookup data set'!$A$2:$C$10,3,FALSE)
    from help files
    VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)
    and as you have found out vlookup always returns the first value only that meet the criteria
    Last edited by martindwilson; 02-13-2011 at 03:27 PM.

  7. #7
    Registered User
    Join Date
    01-29-2011
    Location
    Upland, California
    MS-Off Ver
    Office 365
    Posts
    32

    Re: vlookup issue

    Martin,

    That is it! One thing though. With my actual data containing over 100,000 records/ rows, is there an easy way to create the yellow helper column data?

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: vlookup issue

    just autofil it down

  9. #9
    Registered User
    Join Date
    01-29-2011
    Location
    Upland, California
    MS-Off Ver
    Office 365
    Posts
    32

    Re: vlookup issue

    Thank you!

+ 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