Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default sum of cells that may contain #n/a

If I am summing cells that may or may not contain an error (#n/a) is there a
way to ignore these cells? Or replace (#n/a) with a zero?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default sum of cells that may contain #n/a

Try the below

Please note that this is an array formula. Within the cell in edit mode (F2)
paste this formula and press Ctrl+Shift+Enter to apply this formula. If
successful in 'Formula Bar' you can notice the curly braces at both ends like
"{=<formula}"

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


If this post helps click Yes
---------------
Jacob Skaria


"Troy" wrote:

If I am summing cells that may or may not contain an error (#n/a) is there a
way to ignore these cells? Or replace (#n/a) with a zero?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default sum of cells that may contain #n/a

Hi,

If all the numbers are positive you can get away with

=SUMIF(A1:A20,"0")

if there may be negatives in the range use

=SUM(SUMIF(A1:A20,{"<0","0"}))

Mike

"Troy" wrote:

If I am summing cells that may or may not contain an error (#n/a) is there a
way to ignore these cells? Or replace (#n/a) with a zero?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default sum of cells that may contain #n/a

doesn't seem to be working. Does it matter that the cells I'm summing are
scattered all over my worksheet?

"Troy" wrote:

If I am summing cells that may or may not contain an error (#n/a) is there a
way to ignore these cells? Or replace (#n/a) with a zero?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default sum of cells that may contain #n/a

That's not working.

I still want a sum if only one of the many cells I'm summing as a number
value in it.

"Mike H" wrote:

Hi,

If all the numbers are positive you can get away with

=SUMIF(A1:A20,"0")

if there may be negatives in the range use

=SUM(SUMIF(A1:A20,{"<0","0"}))

Mike

"Troy" wrote:

If I am summing cells that may or may not contain an error (#n/a) is there a
way to ignore these cells? Or replace (#n/a) with a zero?




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default sum of cells that may contain #n/a

Troy,

'doesn't seem to be working' isn't a very useful description of the problem,
post the formula you tried.

Mike

"Troy" wrote:

doesn't seem to be working. Does it matter that the cells I'm summing are
scattered all over my worksheet?

"Troy" wrote:

If I am summing cells that may or may not contain an error (#n/a) is there a
way to ignore these cells? Or replace (#n/a) with a zero?


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default sum of cells that may contain #n/a

Sorry see below.


=SUMIF(H504,H488,H466,"0")




"Mike H" wrote:

Troy,

'doesn't seem to be working' isn't a very useful description of the problem,
post the formula you tried.

Mike

"Troy" wrote:

doesn't seem to be working. Does it matter that the cells I'm summing are
scattered all over my worksheet?

"Troy" wrote:

If I am summing cells that may or may not contain an error (#n/a) is there a
way to ignore these cells? Or replace (#n/a) with a zero?


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default sum of cells that may contain #n/a

Maybe:
=SUM(IF(ISERROR(A1:A6),0,A1:A6))

Enter it with Ctrl+Shift+Enter all at the same time, not just Enter.

Or:
=SUM(IF(ISNUMBER(A1:A6),A1:A6,0))
Same as above; Ctrl+Shift+Enter

HTH,
Ryan---


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Troy" wrote:

Sorry see below.


=SUMIF(H504,H488,H466,"0")




"Mike H" wrote:

Troy,

'doesn't seem to be working' isn't a very useful description of the problem,
post the formula you tried.

Mike

"Troy" wrote:

doesn't seem to be working. Does it matter that the cells I'm summing are
scattered all over my worksheet?

"Troy" wrote:

If I am summing cells that may or may not contain an error (#n/a) is there a
way to ignore these cells? Or replace (#n/a) with a zero?


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default sum of cells that may contain #n/a

Troy,

There has to be a better way but in the meantime try this array formula

=SUM(IF(ISNA(H466),,H466))+SUM(IF(ISNA(H488),,H488 ))+SUM(IF(ISNA(H504),,H504))


This is an array formula which must be entered with CTRL+Shift+Enter and NOT
'just enter. If you do it correctly then Excel will put curly brackets around
'the formula{}. You can't type these yourself. If you Edit the ranges
'then you must re-enter as An array


Mike
"Troy" wrote:

Sorry see below.


=SUMIF(H504,H488,H466,"0")




"Mike H" wrote:

Troy,

'doesn't seem to be working' isn't a very useful description of the problem,
post the formula you tried.

Mike

"Troy" wrote:

doesn't seem to be working. Does it matter that the cells I'm summing are
scattered all over my worksheet?

"Troy" wrote:

If I am summing cells that may or may not contain an error (#n/a) is there a
way to ignore these cells? Or replace (#n/a) with a zero?


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default sum of cells that may contain #n/a

Hi

I would go for your second option:

Or replace (#n/a) with a zero?


In excel 2007 use an "IfError" formula in the cells to sum like this:

=IfError(A1/B1,0)

Which will return a the result of A1/B1 or 0 if the formula return an error.

In previous versions use this:

=IF(ISERROR(A1/B1),0,A1/B1)

Hopes this helps.
....
Per

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
Excel: match two cells in one sheet to two cells in another and return a third cells value Spence Excel Worksheet Functions 3 February 13th 11 05:33 AM
compare 2 column cells and return the adjacent columns cells data of the cell trebor57 Excel Worksheet Functions 1 February 1st 11 02:54 PM
Select Merged Cells and Unmerge Spread Merge Data To All Cells rtwiss via OfficeKB.com Excel Programming 2 October 2nd 08 04:24 AM
display a range of cells editible cells based on matching date Miki Excel Worksheet Functions 0 October 10th 07 03:27 PM
Skip cells with TAB/SHIFT+TAB but allow arrow keys/mouse selection of skipped cells Wescotte Excel Programming 1 June 6th 05 07:00 PM


All times are GMT +1. The time now is 02:01 PM.

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

About Us

"It's about Microsoft Excel"