+ Reply to Thread
Results 1 to 10 of 10

Newbie needs help with VLOOKUP

  1. #1
    Registered User
    Join Date
    12-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    4

    Newbie needs help with VLOOKUP

    Ok, so I just introduced myself in the forums and here I am pleading for help with my first excel problem. I will do my best to describe my problem.

    I created a spreadsheet to track attendance for 30 people for the year. I made a sheet for each month of the year with each employee's name down the first column alphabetically, and the days of the month across the top. Info regarding which type of leave is being used (vacation, sick, etc) is entered in the appropriate cell by way of a drop down menu. So there are 12 sheets (1 for each month) for entering info, then there's a sheet for each employee. These employee sheets have the months of the year down the first column and each day of the month going across. The cells in these employee sheets grab the info that is entered in each month sheet.

    Here's my problem:

    I originally accomplished grabbing the info with an IF formula. This worked fine but when I needed to remove a name or add names, I had to redo every employee sheet that was affected by the change. The the IF formula was grabbing info according to a specific location, so when a name was removed and the other names shifted up or down as a result, the employee sheet was now grabbing from a different employee.

    I tried to fix this issue by redoing the employee sheets and changing the IF formula to a VLOOKUP formula. This seems to accomplish what I need but when I create the first VLOOKUP formula and try to drag it across the row, the table array changes incrementally and the column index number stays the same. I need the column index number to change incrementally, and I need the table array to remain the same.

    The VLOOKUP formula I am using is: =VLOOKUP("Smith",January!A6:AG39,5,FALSE)
    when I try to drag this formula across it changes to: =VLOOKUP("Smith",January!B6:AH39,5,FALSE)

    I need it to change to: =VLOOKUP("Smith",January!A6:AG39,6,FALSE)
    then the next one to: =VLOOKUP("Smith",January!A6:AG39,7,FALSE) and so on.

    Is there a way to tweak the VLOOKUP formula to accomplish this, or is there another formula that someone could suggest? Just bear in mind that I'm a newbie and get confused very easily.

    Thanks in advance.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,630

    Re: Newbie needs help with VLOOKUP

    Try =VLOOKUP("Smith",January!$A$6:$AG$39,column(),FALSE) that is assuming the formula is in column E (column() then returns 5 and when dragged across, 6, etc..) if it is in another column adapt the column() part by adding or deleting a number so that column() + or - something =5

  3. #3
    Registered User
    Join Date
    12-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Newbie needs help with VLOOKUP

    Thanks for the quick reply! I'm gonna give it a shot now. It takes me some time to figure this stuff out so I'll let you know how it works as soon as I can. Thanks again.

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Newbie needs help with VLOOKUP

    add all the sheets in one sheet (or use an macro to do that for that).

    then you can use pivot table for your problem.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Registered User
    Join Date
    12-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Newbie needs help with VLOOKUP

    Pepe you are AWESOME! It works but created a different issue. Now if there's no info in the cell to grab, your formula returns a 0. I need it to stay blank. Is that easy to fix?

    Oh, and oeldere thank you also for replying but I'm such a noob I don't know how to do macros and pivot tables.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,049

    Re: Newbie needs help with VLOOKUP

    welcome to the forum

    try =if(VLOOKUP("Smith",January!$A$6:$AG$39,column(),FALSE)=0,"",VLOOKUP("Smith",January!$A$6:$AG$39,column(),FALSE)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Newbie needs help with VLOOKUP

    Using the formula of pepe and the answer to your question.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    12-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Newbie needs help with VLOOKUP

    Worked like a charm FDibbins! Thanks to you and Pepe I'll have this attendance spreadsheet up and running by the new year. You Excel Gurus are AWESOME!

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,049

    Re: Newbie needs help with VLOOKUP

    @ Frankie, happy to help and thanks for the rep

    @oeldere, i think the OP was asking how to "hide" a zero return. you're iferror() will work if "Smith" isnt found

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Newbie needs help with VLOOKUP

    @fdibbins

    you totaly right, didn't read well enough.

+ 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