+ Reply to Thread
Results 1 to 2 of 2

alternative to vlookup when search column has target value more than once

  1. #1
    Registered User
    Join Date
    02-09-2012
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2003
    Posts
    4

    alternative to vlookup when search column has target value more than once

    I have a sheet to search with column 1 having dates (1/1/12 - 12/31/12). each row has 5 columns with data

    1/1/2012 AUSTIN MU2 SOCCER FIRM
    1/1/2012 HOUSTON MU1 BASEBALL HOLD
    1/7/2012 AUSTIN MU2 SOCCER FIRM
    1/9/2012 HOUSTON MU2 SOCCER FIRM
    1/9/2012 HOUSTON MU1 BASEBALL FIRM

    ETC

    NO ROWS ARE BLANK, DAYES IN ROW 1 ARE IN ASCENDING ORDER
    A ROW CAN HAVE 1 DATE OR THE SAME DATE TWICE

    I'M searching for a date, and I want to display the information for either MU1 or MU2 in a cell
    ---------
    Here's the best way to demonstrate:
    look for date 1/7/2012 in column 1
    found date in column 1, row 1 - look in column 4 for "MU1"
    if row 12 column 4 contains "MU1", then report contents of row 12 Column 5
    if row 12 col 4 dows NOT contain "MU1", look in the next row col 1 for 1/7/2012

    I could write it in GWbasic, but not in VBasic.

    I can use VLookup, but if the target search column (Col1) has more that 1 instance of the target value (1/7/12),
    the search fails. I can't change the structure of the searched array.

    If you can understand this and have any ideas, I would be in your debt.

    Thanks,
    -- Doc

  2. #2
    Registered User
    Join Date
    02-09-2012
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: alternative to vlookup when search column has target value more than once

    I've attached a sheet which might make my objective a little more clear. I am interested in filling out two areas of each day in the calendar, but only if MU1 has an event that day (pink) and/or MU2 has an event that day(blue). Column A is the date, Column C indicates the unit (MU-LYON 1 (PINK)or MU-LYON 2 (BLUE), Columns F and G indicate the assignment for the day. The assignment for the day is what I want in the calendar block each day.
    Problem is, with VLOOKUP (I've omitted all the error correction and "N/A" filters for clarity), if there are duplicate entries in the key column (a), then Vlookup seems to ignore subsequent rows with the same contents. Unless I have missed something. What I thought it would do is
    Look in col A for target date, if a match, look in col A for the date, if it is there, get other data in the same row, but if the other data isn't the same, look for the next date.
    I could write this in GW Basic (yeah, I am that old), but I'd rather use the dynamic features of Excel.
    Thanks for listening, and MANY THANKS for any help.
    -- Doc
    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)

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