Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Sum Function with Error values

Hi,

Can anyone please let me know how can I add some values in a column
which contains some #N/A.

Thanks.

MH

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Sum Function with Error values

Good practice would generally recommend that you eliminate the #N/As,
instead, to avoid having "expected" errors. If they're being generated
from a lookup, you can use something like

=IF(ISNA(VLOOKUP(...)),"Not Found",VLOOKUP(...))

in which case SUM will ignore the text.

You can, though, use this array-entered (CTRL-SHIFT-ENTER or CMD-RETURN)
formula:

=SUM(IF(ISNA(A1:A50),0,A1:A50))

In article .com,
wrote:

Hi,

Can anyone please let me know how can I add some values in a column
which contains some #N/A.

Thanks.

MH

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Sum Function with Error values

On Mar 26, 6:41 am, wrote:
Can anyone please let me know how can I add some values in a column
which contains some #N/A.


One way: the following array formula (commit with ctrl-shift-Enter,
not just Enter):

=sum(if(iserror(A1:A10),0,A1:A10))

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Sum Function with Error values

Better to use ISNA() than ISERROR() to avoid masking other errors.

In article .com,
"joeu2004" wrote:

On Mar 26, 6:41 am, wrote:
Can anyone please let me know how can I add some values in a column
which contains some #N/A.


One way: the following array formula (commit with ctrl-shift-Enter,
not just Enter):

=sum(if(iserror(A1:A10),0,A1:A10))

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Sum Function with Error values

On Mar 26, 7:08 am, JE McGimpsey wrote:
Better to use ISNA() than ISERROR() to avoid masking other errors.


You are correct that ISNA() fits a literal reading of the OP's
inquiry. But I am reasonably sure that if the OP wants to avoid #N/A
errors, the OP probably wants to avoid all errors, without caring
which one it is. The other errors will not be masked. They will
appear exactly where they belong, namely in the cells that cause any
error initially. The OP simply wants to avoid propagating errors that
the OP has chosen to tolerate. Using ISERROR() is more flexible in
that respect.

Of course, that is merely my opinion and my interpretation of the
inquiry. It is just as valid or invalid as your interpretation.
Either or us could be equally wrong or right.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Sum Function with Error values

I don't know what you're basing being "reasonably sure" on, but it's a
bad idea, even if the OP thinks he wants it.

Having audited hundreds of complex workbook systems, I can say with
reasonable authority that using ISERROR() is near the top of the list
for generating erroneous results, leading to bad decisions based on
those results. I certainly wasn't able to infer as much of the OP's
intent from his single sentence as you were, but IMO having a dependent
function return a valid value when an unexpected error occurs in its
arguments is a first-class design foul-up.

For better or worse (mostly worse), XL returns #N/A as an "expected
error" for some functions, e.g., VLOOKUP. Trapping it with ISERROR()
means that if a precedent calculation returns, say, #DIV/0 due to an
invalid or unanticipated condition, that THAT error will be ignored,
and, depending on how the data is laid out, it may *not* be clearly
exposed (and you just have to read these groups to see how many people
*don't* check their data first when they get an error). The probability
of missing the error in the precedent cells approaches 1 as the amount
of data increases.

That's why I fully expect XL2007's new IFERROR() function to lead to
lowered reliability. It's great when used to flag an unexpected error.
It will lead to wrong results when used to mask them.

And, as you said, that's my opinion.



In article .com,
"joeu2004" wrote:

On Mar 26, 7:08 am, JE McGimpsey wrote:
Better to use ISNA() than ISERROR() to avoid masking other errors.


You are correct that ISNA() fits a literal reading of the OP's
inquiry. But I am reasonably sure that if the OP wants to avoid #N/A
errors, the OP probably wants to avoid all errors, without caring
which one it is. The other errors will not be masked. They will
appear exactly where they belong, namely in the cells that cause any
error initially. The OP simply wants to avoid propagating errors that
the OP has chosen to tolerate. Using ISERROR() is more flexible in
that respect.

Of course, that is merely my opinion and my interpretation of the
inquiry. It is just as valid or invalid as your interpretation.
Either or us could be equally wrong or right.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 837
Default Sum Function with Error values

For the special case of SUM, 0 can replace #N/A values. More generally the
array formula
=SUM(IF(ISNA(A1:A50),"",A1:A50))
would still work if SUM were replaced with a different function.

Jerry

"JE McGimpsey" wrote:

Good practice would generally recommend that you eliminate the #N/As,
instead, to avoid having "expected" errors. If they're being generated
from a lookup, you can use something like

=IF(ISNA(VLOOKUP(...)),"Not Found",VLOOKUP(...))

in which case SUM will ignore the text.

You can, though, use this array-entered (CTRL-SHIFT-ENTER or CMD-RETURN)
formula:

=SUM(IF(ISNA(A1:A50),0,A1:A50))

In article .com,
wrote:

Hi,

Can anyone please let me know how can I add some values in a column
which contains some #N/A.

Thanks.

MH

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error bar values Trichotos Excel Worksheet Functions 1 February 23rd 07 09:01 PM
Error bar values Trichotos Excel Worksheet Functions 0 February 23rd 07 06:43 PM
Make Function ignore 0 and error values AD108 Excel Worksheet Functions 3 November 4th 06 07:03 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Error Handling #N/A with AVERAGE Function - Average of values in Row Sam via OfficeKB.com Excel Worksheet Functions 13 July 31st 05 03:59 PM


All times are GMT +1. The time now is 03:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"