+ Reply to Thread
Results 1 to 7 of 7

How do I sum a range which includes the "#N/A" VLOOKUP return valu

  1. #1
    Sailor
    Guest

    How do I sum a range which includes the "#N/A" VLOOKUP return valu

    Excell 2002

    I am using numerous VLOOKUP functions (including the "FALSE" option) accross
    a row to extract exact values from the same range, which may or may not
    contain the look-up value. I then want to sum accross the row to give me a
    running total. The problem is that VLOOKUP returns "#N/A" when an exact
    match is not found; which then returns a "#N/A" error in the sum function.

  2. #2
    arno
    Guest

    Re: How do I sum a range which includes the "#N/A" VLOOKUP return valu

    Hi Sailor,

    > I am using numerous VLOOKUP functions (including the "FALSE" option)
    > accross a row to extract exact values from the same range, which may
    > or may not contain the look-up value. I then want to sum accross the
    > row to give me a running total. The problem is that VLOOKUP returns
    > "#N/A" when an exact match is not found; which then returns a "#N/A"
    > error in the sum function.


    you have to avoid #n/a with a formula like

    =if(iserror(vlookup(something), 0, vlookup(something))

    here the " 0 " is shown instead of the error, this will allow you to
    sum up everything. Instead of " 0 " you can use anything that will
    allow the sum-function to work (eg. texts like "not available", "---",
    "", etc).

    arno


  3. #3
    Max
    Guest

    Re: How do I sum a range which includes the "#N/A" VLOOKUP return valu

    Instead of using say, in B1: = VLOOKUP(A1,Sheet2!A:B,2,0)

    Use an " =IF(ISNA(VLOOKUP(...)),0, VLOOKUP(...))"
    error-trap construct to return zeroes for any non-matches instead of #NAs.

    For example, you could use in B1:

    =IF(ISNA(VLOOKUP(A1,Sheet2!A:B,2,0)),0,VLOOKUP(A1,Sheet2!A:B,2,0))

    Downstream SUMs, etc will now work ok.
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----
    "Sailor" <[email protected]> wrote in message
    news:[email protected]...
    > Excell 2002
    >
    > I am using numerous VLOOKUP functions (including the "FALSE" option)

    accross
    > a row to extract exact values from the same range, which may or may not
    > contain the look-up value. I then want to sum accross the row to give me

    a
    > running total. The problem is that VLOOKUP returns "#N/A" when an exact
    > match is not found; which then returns a "#N/A" error in the sum function.




  4. #4
    arno
    Guest

    Re: How do I sum a range which includes the "#N/A" VLOOKUP return valu

    ooops,
    > =if(iserror(vlookup(something), 0, vlookup(something))


    correct:
    =if(iserror(vlookup(something)), 0, vlookup(something))


  5. #5
    Biff
    Guest

    Re: How do I sum a range which includes the "#N/A" VLOOKUP return valu

    Hi!

    If you do want the #N/A's to display try this:

    =SUMIF(A1:L1,"<>#N/A")

    Biff

    "Sailor" <[email protected]> wrote in message
    news:[email protected]...
    > Excell 2002
    >
    > I am using numerous VLOOKUP functions (including the "FALSE" option)
    > accross
    > a row to extract exact values from the same range, which may or may not
    > contain the look-up value. I then want to sum accross the row to give me
    > a
    > running total. The problem is that VLOOKUP returns "#N/A" when an exact
    > match is not found; which then returns a "#N/A" error in the sum function.




  6. #6
    Max
    Guest

    Re: How do I sum a range which includes the "#N/A" VLOOKUP return valu

    Alternatively, instead of correcting the source VLOOKUP returns
    you could also try an array " SUM(IF(ISNUMBER(...), ... )" formula,
    instead of the normal SUM formula

    E.g.: instead of say, in E1: =SUM(C1:D1)

    Put in E1, and array-enter (press CTRL+SHIFT+ENTER):
    =SUM(IF(ISNUMBER(C1:D1),C1:D1))
    which will ignore any "#NA" returns in C1:D1

    Then just fill E1 down, as per normal
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----



  7. #7
    Aladin Akyurek
    Guest

    Re: How do I sum a range which includes the "#N/A" VLOOKUP returnvalu

    Sailor wrote:
    > Excell 2002
    >
    > I am using numerous VLOOKUP functions (including the "FALSE" option) accross
    > a row to extract exact values from the same range, which may or may not
    > contain the look-up value. I then want to sum accross the row to give me a
    > running total. The problem is that VLOOKUP returns "#N/A" when an exact
    > match is not found; which then returns a "#N/A" error in the sum function.


    =SUMIF(Range,"<>#N/A")

+ 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