ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sum of a column if some rows contain #n/a (https://www.excelbanter.com/excel-programming/399945-sum-column-if-some-rows-contain-n.html)

BZeyger

Sum of a column if some rows contain #n/a
 
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

JE McGimpsey

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



All times are GMT +1. The time now is 12:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com