+ Reply to Thread
Results 1 to 6 of 6

lookup date in column, search columns to right for name, return "x"

  1. #1
    Registered User
    Join Date
    07-14-2010
    Location
    Hot Springs, AR
    MS-Off Ver
    2010
    Posts
    38

    lookup date in column, search columns to right for name, return "x"

    I have two worksheets. Sheet1 has dates in Col A and names in several columns (up to 8) to the right. Sheet 2 has all possible names in Col A, then dates (1-31) in columns to right. What I need is to put an "X" in the proper column for which day they pull shift. VLOOKUP works for column specific, ie. =vlookup(B2,sheet1!A1:A31,2,false) for whatever name it finds in Col 2, but I want it to look up the date in Col A Sheet 2, look for Bob in columns to right and return an "X" in cell for that day in Sheet2.


    Thanks
    Attached Files Attached Files
    Last edited by roothog; 11-21-2012 at 05:58 PM. Reason: added file

  2. #2
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: lookup date in column, search columns to right for name, return "x"

    IGNORE THIS... see next thread instead... Fotis has a great solution... nice work!

    Hi roothog,

    Convert your data first... follow this thread...

    http://www.excelforum.com/excel-prog...-vertical.html

    Once you have the new data set, simply use pivot table to accomplish what you need.

    Dennis
    Last edited by djapigo; 11-21-2012 at 06:20 PM.

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: lookup date in column, search columns to right for name, return "x"

    In B2 and copy down and across.

    =IF(SUMPRODUCT((Sheet1!$B$1:$E$3=Sheet2!$A2)*(Sheet1!$A$1:$A$3=Sheet2!B$1))>0,"X","")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    07-14-2010
    Location
    Hot Springs, AR
    MS-Off Ver
    2010
    Posts
    38

    Re: lookup date in column, search columns to right for name, return "x"

    Fotis,

    Works perfectly. I tried sumproduct in my quest for a solution but never used the "if" with it. Thanks for you quick response!

  5. #5
    Registered User
    Join Date
    07-14-2010
    Location
    Hot Springs, AR
    MS-Off Ver
    2010
    Posts
    38

    Re: lookup date in column, search columns to right for name, return "x"

    Dennis,

    Thanks for you response as well. Ignored per your request! As you can see in my reply to Fotis, his worked nicely!

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: lookup date in column, search columns to right for name, return "x"

    You are welcome.

    Thanks for the reb * and for your kind comments.

    @Dennis

    Thank you too for your kind comments.

+ 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