+ Reply to Thread
Results 1 to 6 of 6

VLOOKUP returns error if value is not in all sheets?

  1. #1
    Registered User
    Join Date
    09-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    VLOOKUP returns error if value is not in all sheets?

    Hi, I'm pretty new to excel and very new to this forum so I'm sorry if this is an easy-to-answer question. My excel vocabulary is probably not the most accurate either, but if you can understand this any help you can provide would be much appreciated thank you!

    I'm using VLOOKUP to return and average values from 10 sheets. When I drag the formula it works great, but only for the lookup values that are found in every sheet. Some lookup values are only in 2 or 3 sheets, but instead of giving me the average of those values it returns an error (#N/A).

    Is there a way to tell the formula to lookup the values only if the lookup value is found in the sheet? I think that's the easiest way to put it. Thanks again for reading and hopefully I don't have to go in and edit each formula manually haha.

    Cheers,
    Mike

  2. #2
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: VLOOKUP returns error if value is not in all sheets?

    Can you provide us with a sample of your workbook and the formula?

    Thanks

  3. #3
    Registered User
    Join Date
    09-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VLOOKUP returns error if value is not in all sheets?

    [post deleted to take down sample docs sorry]
    Last edited by MJ10; 09-21-2013 at 06:13 PM. Reason: Needed to take down sample docs

  4. #4
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: VLOOKUP returns error if value is not in all sheets?

    Hello,

    1. Its better of you name the ranges and then use them in your formula. Read this article on how to do that.
    http://office.microsoft.com/en-us/ex...010147120.aspx
    It will make your formula look cleaner and less cluttered. I would name the range in each year something like " year2008" and so on, so your formula would look something like this:


    Formula: copy to clipboard
    Please Login or Register  to view this content.


    2. You need to place an IFERROR after each VLOOKUP ( if you have excel 2003 or earlier you will have to use the IF and ISNA to trap the error.
    Here is a short version of how it should look

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Thanks a lot

  5. #5
    Registered User
    Join Date
    09-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VLOOKUP returns error if value is not in all sheets?

    Thank you! The named range makes it much easier. Very Much appreciated

  6. #6
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: VLOOKUP returns error if value is not in all sheets?

    I am glad I was able to help. If you question was solved and my help was beneficial; please do not forget to mark the thread as solved and add reputation.

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to error trap a vlookup that returns an error or #N/A
    By kjy1989 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-06-2013, 12:01 PM
  2. sumif vlookup returns an error
    By krunk in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-20-2013, 05:04 PM
  3. VBA Vlookup returns 1004 error
    By Sportz234 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 03-15-2013, 03:08 PM
  4. Error? VLOOKUP returns 0 instead of proper value.
    By Hatchiman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-18-2010, 02:42 AM
  5. [SOLVED] If Vlookup returns error enter 0
    By Midwest User in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-28-2006, 12:15 PM

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