Excel User Group
Microsoft Excel blogs, forums, files. Read, ask questions, provide answers.

Avoiding errors when using VLOOKUP on a series of spreadsheet values.

Latest post Fri, Nov 14 2008 12:43 PM by GR8DAYNE. 2 replies.
  • Thu, Nov 13 2008 3:00 PM

    • GR8DAYNE
    • Top 200 Contributor
    • Joined on Thu, Nov 13 2008
    • Posts 2
    • Points 26

    Avoiding errors when using VLOOKUP on a series of spreadsheet values.

    I have several spreadsheets which rollup to a higher level, summary sheet.  Each sheet has a column of names and columns for each month with hours for each name for that month.  I need these three spreadsheets to rollup the hours for each person to the summary level spreadsheet.  I currently use VLOOKUP to add these values together on the summary sheet.  However if a name is different on one of the sheets it will return an error on my summary sheet.  The only way I have found to avoid this is to have all names on all the spreadsheets.  Is there a way to avoid adding a name to all of the spreadsheets where it isn't useful and still have the formula on the summary sheet find the name and total the hours for the sheets under it that do contain that name?

    Filed under:
    • Post Points: 21
  • Fri, Nov 14 2008 2:45 AM In reply to

    • Nick Hodge
    • Top 10 Contributor
    • Joined on Sun, Dec 23 2007
    • Southampton
    • Posts 336
    • Points 5,771
    • MVP

    Re: Avoiding errors when using VLOOKUP on a series of spreadsheet values.

    When you want a VLOOKUP (or other functions) to return nothing (or zero) when the looked up item do not exist, you use a combination of IF, ISNA and VLOOKUP, like this

    =IF(ISNA(VLOOKUP(...your original VLOOKUP)),"",VLOOKUP(...Your Original VLOOKUP))

    This will return "" (nothing) if the VLOOKUP data is not available, replace this with a zero if you want to return a zero. (The latter is generally better for SUM, but be careful when using in an AVERAGE, "" (nothing) will not be counted, zero will

    Regards
    Nick Hodge
    Microsoft MVP, Excel
    Southampton, UK

    Filed under:
    • Post Points: 21
  • Fri, Nov 14 2008 12:43 PM In reply to

    • GR8DAYNE
    • Top 200 Contributor
    • Joined on Thu, Nov 13 2008
    • Posts 2
    • Points 26

    Re: Avoiding errors when using VLOOKUP on a series of spreadsheet values.

    This is an example of what we currently use:  =IF(ISERROR(VLOOKUP($A18,'T:\(…my file location…)\[task 25.xls]Planned'!$A$11:$AZ$73,E$6,FALSE)),0,VLOOKUP($A18,'T:\(…my file location…)\[task 25.xls]Planned'!$A$11:$AZ$73,E$6,FALSE)

    If the name is not on that spreadsheet then it returns an error instead of a “0”.  Does using ISNA instead of ISERROR make a difference?

    • Post Points: 5
Page 1 of 1 (3 items) | RSS
Copyright Excel User Group and the relevant contributors, 2008. All Trade Marks acknowledged. This site is a peer-to-peer site and NOT affiliated in any way to Microsoft Corp. All rights reserved.