View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Sum of a column if some rows contain #n/a

The best way would be to eliminate the NA's. For instance, if they're
generated by a VLOOKUP(), trap the "match not found" error:

=IF(ISNA(MATCH(A1,J:J,FALSE)),"",VLOOKUP(A1,J:K,2, FALSE))

But you could also use this (array-entered: CTRL-SHIFT-ENTER or
CMD-RETURN):

=SUM(IF(ISNA(B1:B100),,B1:B100))

In article ,
BZeyger wrote:

I am looking to add the contents of a column. Some of the values contain
#N/A. Is there a way to add the all of the values in the colums together ,
but ingnore the #N/A?

example:

Object 1 2
Object 2 #N/A
Object 3 #N/A
Object 4 1

Total 3