+ Reply to Thread
Results 1 to 16 of 16

Using VLOOKUP command

  1. #1
    Registered User
    Join Date
    01-20-2010
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    10

    Using VLOOKUP command

    Here is my situation.

    Column A- Last (Name) - Contains about 1000
    Column B- First (Name) - Contains about 1000
    Column C- Date of Birth - Contains about 1000
    Column E- Last, First - Contains about 200 and is a subset of column A and B

    Column D- I created this to be =A2&","&" "&B2 so that it merges columns A and B to be in the format of coumn E

    Column F- =VLOOKUP(E2,D2:D1000,3,FALSE)

    I did this to try to pull out the DOB's for my subset but am getting a "#REF!" error which makes sense because the actual data in column D is a formula, not "Last, First" data.

    I tried just doing "text to column" for column E and then using the VLOOKUP command based on the new Last name only column that was created from the "text to column" and column A.

    This worked, however, if there was more than one person with the same last name, it kicks out the DOB for the first match it comes to, i.e. not taking into account the first name and giving me an incorrect DOB.

    Does anyone know how I can use the VLOOKUP command to do this?

    Or is there another option? A better, easier method?

    Thanks!!!

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,053

    Re: Using VLOOKUP command

    Can you upload example?
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    01-20-2010
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Using VLOOKUP command

    Here is a screen shot of the first bit of my data. Only provided some because I had to change names, dates, etc for privacy reasons.

    http://livelesson.connectionsacademy.com/p32817444/


    Cell D2 = A2&","&" "&B2
    Cell F2 =VLOOKUP(E2,D2:D1000,3,FALSE)

    Column A contains around 1000 Last Names
    Column B contains around 1000 First Names
    Column C contains around 1000 Date of Births
    Column D is a column that I made using the above formula
    Column E contains around 200 Last, First Names
    Column F is a column that I made trying to pull the DOB's for Column E names from Column C.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using VLOOKUP command

    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!
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  5. #5
    Registered User
    Join Date
    01-20-2010
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Using VLOOKUP command

    Sorry, I am new to this site, how exactly do you attach files? Thanks

  6. #6
    Registered User
    Join Date
    01-20-2010
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Using VLOOKUP command

    Here is the example
    Attached Files Attached Files

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using VLOOKUP command

    Click New Post

    Click the paperclip icon and Browse and Upload file

    Add a few words in the message area and clikc Post Reply.

    Edit... I guess you figured it out!

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using VLOOKUP command

    What is it you actually want to do? Just see if the item in column E exists in column D?

    If so

    =Isnumber(Match(E2,$D$2:$D$1000,0)) will give TRUE if match found, FALSE if not.

  9. #9
    Registered User
    Join Date
    01-20-2010
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Using VLOOKUP command

    Actually I want a column F of Date Of Births which corresponds with the names in column E. And then I want to be able to sort by my new column of birthdays.

    Column D is a list of all high school students in my school. Column E is a list of just my students. I want to be able to create a Column F of my students birthdays without having to go through all 1000 high school students and pick out which 200 students are mine and find their birthday.

    And then I want to be able to sort the list by my students DOB.
    Last edited by ericrminton; 01-25-2010 at 05:04 PM.

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using VLOOKUP command

    Try:

    =IF(ISNUMBER(MATCH(E2,$D$2:$D$1000,0)),INDEX($C$2:$C$1000,MATCH(E2,$D$2:$D$1000,0)),"")

    copied down.

  11. #11
    Registered User
    Join Date
    01-20-2010
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Using VLOOKUP command

    Well that seemed to work (see attachment) however the numbers that it produced do not relate to actual DOB's that I can tell. If they do, I'm not seeing how.

    Also, eventually I'd like to put the DOB's in order that they would appear throughout the calendar year regardless of year of birth.

    So eventually I would like them to appear as follows

    Name1 ...... 1/5/1994
    Name2 ...... 1/7/1992
    Name3 ...... 1/9/1995
    Name4...... 1/11/1993
    Name5 ...... 1/15/1991
    Name6 ...... 1/19/1994

    etc

    or more generally

    Name1 ...... 1/5
    Name2 ...... 1/7
    Name3 ...... 1/9
    Name4 ...... 1/11
    Name5 ...... 1/15
    Name6 ...... 1/19
    Attached Files Attached Files

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using VLOOKUP command

    You need to format that column now as dates.. Format|Cells and in Number tab choose Date and then choose from the Type options...

    Then try sorting by Column F

  13. #13
    Registered User
    Join Date
    01-20-2010
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Using VLOOKUP command

    Ok I figured out how to format them so they appear in the date format, but when I sort by column F they are showing up from youngest to oldest .... which is not exactly how I want to sort.

    I would like to sort by birthdate (month and day) regardless of year of birth.

    So eventually I would like them to appear as follows

    Name1 ...... 1/5/1994
    Name2 ...... 1/7/1992
    Name3 ...... 1/9/1995
    Name4...... 1/11/1993
    Name5 ...... 1/15/1991
    Name6 ...... 1/19/1994

    Right now what I have is

    Name5 ...... 1/15/1991
    Name2 ...... 1/7/1992
    Name4...... 1/11/1993
    Name1 ...... 1/5/1994
    Name6 ...... 1/19/1994
    Name3 ...... 1/9/1995

  14. #14
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using VLOOKUP command

    I think you would need to add another column with formula =DATE(YEAR(TODAY()),MONTH(F2),DAY(F2)) copied down and sort by that column

  15. #15
    Registered User
    Join Date
    01-20-2010
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Using VLOOKUP command

    Figured it out with the following code

    =MONTH(F2)*100+DAY(F2)

    And then sort by that column.

    NBVC Thanks for all your help!

    Now how to I mark it as resolved?

  16. #16
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using VLOOKUP command

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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