+ Reply to Thread
Results 1 to 7 of 7

Sum excluding n/a's

Hybrid View

  1. #1
    Registered User
    Join Date
    07-11-2007
    Posts
    25

    Sum excluding n/a's

    Hi there,

    I have a column that i want the sum of but some cells contain #n/a as the value is a lookup from a different worksheet and it doesnt contain a value.

    I tried the normal SUM function but because some values are #n/a the result comes out as #n/a. Is there a way to exclude these from the SUM? I've tried SUM IF and COUNT IF but cant figure it out.

    Thanks,

    Tim

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

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

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    07-11-2007
    Posts
    25
    That works great thanks. Is there a way of multiplying two sells excluding the #n/a? Something like a MultiplyIF function, if such a thing exists!!

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Can you post an example

    VBA Noob

  5. #5
    Registered User
    Join Date
    07-11-2007
    Posts
    25
    A B
    #N/A 4
    12 9
    4 8
    #N/A 6


    Want to multiply these columns together but to exclude the #N/A, or if it is there, to return result as 0. Any ideas?

  6. #6
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    for a single cell
    =IF(ISERROR(A1*B1),0,A1*B1)

    for a range, entered as an array, so with shift ctrl enter instead of enter at the end

    =SUM(IF(ISERROR(A1:A9*B1:B9),0,A1:A9*B1:B9))

    Regards

    Dav

+ 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