+ Reply to Thread
Results 1 to 5 of 5

Vlookup and get rid of N/A error

Hybrid View

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    england
    MS-Off Ver
    Office 2013
    Posts
    55

    Vlookup and get rid of N/A error

    Hi Guys, I am probably going about this the wrong way but I am trying to do the following:

    1) I have a column next to my employees list that identifies the department they work in, e.g. MFRF or MFRR or MFRP.

    These are the codes I am forced to use as this is how the information is given to me via the accounts department.

    I need to sort them by department and breakdown the labour costs per department.

    To that end I have created 3 columns that sit at the side of the employee list.
    Each column has a header, e.g MFRF or MFRR etc

    I have used Vlookup, which essentially looks at the code of it's respective column then looks at the code for the employee on that row and if it is the same it returns the amount of hours that employee has worked in the column that matches that employees code.

    The problem I am having is that if the employee code doesn't match the code at the head of the column it returns "N/A"

    I would like it to return "0"

    Is there a way of doing this, or an alternative approach to the problem?

    Hope this makes sense.

    I've attached the spread sheet so far to help you make sense of the problem.
    The concept is that when I get the hours which will be formatted exactly as they are in the red box but on a seperate sheet. I can copy the hours as they are and paste them into the red box on my sheet.

    This should then automaticallt break the hours down by department and then the front sheet I haven't made yet will detail the hours by department on a week to week basis throughout the year.

    The sheet you can will be replicated 52 times and updated weekly pasting the figure into the appropriate sheet.

    Regards

    Marv
    Attached Files Attached Files
    Last edited by NBVC; 11-30-2010 at 11:07 AM.

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

    Re: Vlookup

    How about in R11:

    =IF($E11=R$10,$O11,0)

    copied down the column and over to the next 2 columns.
    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.

  3. #3
    Registered User
    Join Date
    06-29-2010
    Location
    Central Texas
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: Vlookup

    You can use an IFERROR statement,

    =IFERROR({your VLOOKUP statement}, 0 )

    This will return 0 if the VLOOKUP returns an error.
    Harley2

    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)

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

    Re: Vlookup

    IFERROR doesn't work in pre XL2007

  5. #5
    Registered User
    Join Date
    11-03-2008
    Location
    england
    MS-Off Ver
    Office 2013
    Posts
    55

    Re: Vlookup

    Thanks guys, I went for NBVC's option in the end as I am using Office 2003 and it works a treat :o)

    Many Thanks for once again bailing me out

    Regards

    Martyn

+ 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