Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
René
 
Posts: n/a
Default How do I sum an array of cells, even if some of them are #N/A

I have a table where I lookup working hours in a "Incident reporting sheet"
I want to sum these hours per week. Some of the cells are invalid (#N/A),
because there were no incidents that day. But then I can't get the sum for
those specific weeks. How do I ignore the invalid cells in summing those
arrays?
  #2   Report Post  
Leo Heuser
 
Posts: n/a
Default

One way:

=SUM(IF(ISERROR(A2:A100),0,A2:A100))

The formula is an array formula and must be
entered with <Shift<Ctrl<Enter, also if
edited later.

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"René" skrev i en meddelelse
...
I have a table where I lookup working hours in a "Incident reporting

sheet"
I want to sum these hours per week. Some of the cells are invalid (#N/A),
because there were no incidents that day. But then I can't get the sum for
those specific weeks. How do I ignore the invalid cells in summing those
arrays?



  #3   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

=SUMIF(Range,"<#N/A")

René wrote:
I have a table where I lookup working hours in a "Incident reporting sheet"
I want to sum these hours per week. Some of the cells are invalid (#N/A),
because there were no incidents that day. But then I can't get the sum for
those specific weeks. How do I ignore the invalid cells in summing those
arrays?

  #4   Report Post  
JMay
 
Posts: n/a
Default

Why doesn't:
=SUMPRODUCT((ISNUMBER(A1:A5))*(A1:A5))
work?
It still produces #N/A
TIA,


"Aladin Akyurek" wrote in message
...
=SUMIF(Range,"<#N/A")

René wrote:
I have a table where I lookup working hours in a "Incident reporting

sheet"
I want to sum these hours per week. Some of the cells are invalid

(#N/A),
because there were no incidents that day. But then I can't get the sum

for
those specific weeks. How do I ignore the invalid cells in summing those
arrays?



  #5   Report Post  
Jason Morin
 
Posts: n/a
Default

It doesn't work because you're trying to multiply values=20
with errors. If A3 were #N/A, you get:

=3D{TRUE;TRUE;FALSE;TRUE;TRUE}*{3;4;#N/A;3;2}

which produces

{3;4;#N/A;3;2}

Trying to perform an operation (add,multiply,etc.) on an=20
error value only returns another error. Aladin's formula=20
simply ignores #N/A, while Leo's converts those error=20
values to 0.

HTH
Jason
Atlanta, GA

-----Original Message-----
Why doesn't:
=3DSUMPRODUCT((ISNUMBER(A1:A5))*(A1:A5))
work?
It still produces #N/A
TIA,


"Aladin Akyurek" wrote in message
...
=3DSUMIF(Range,"<#N/A")

Ren=E9 wrote:
I have a table where I lookup working hours in=20

a "Incident reporting
sheet"
I want to sum these hours per week. Some of the=20

cells are invalid
(#N/A),
because there were no incidents that day. But then I=20

can't get the sum
for
those specific weeks. How do I ignore the invalid=20

cells in summing those
arrays?



.



  #6   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

Adding to Jason's note... That SumProduct formula does not filter out
the #N/A's. Filtering would require a conditional with IF. Adding such a
conditional as a term to a SumProduct formula would force us to confirm
it with control+shift+enter. In such cases, it's better to switch to an
appropriate "array" formula.

JMay wrote:
Why doesn't:
=SUMPRODUCT((ISNUMBER(A1:A5))*(A1:A5))
work?
It still produces #N/A
TIA,


"Aladin Akyurek" wrote in message
...

=SUMIF(Range,"<#N/A")

René wrote:

I have a table where I lookup working hours in a "Incident reporting


sheet"

I want to sum these hours per week. Some of the cells are invalid


(#N/A),

because there were no incidents that day. But then I can't get the sum


for

those specific weeks. How do I ignore the invalid cells in summing those
arrays?




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
To safety merge cells without data destroyed, and smart unmerge! Kevin Excel Discussion (Misc queries) 0 December 30th 04 07:17 AM
Heps to design Locked/Unlocked cells in protected worksheet Kevin Excel Discussion (Misc queries) 0 December 30th 04 07:09 AM
Convert data of cells to any type: Number, Date&Time, Text Kevin Excel Discussion (Misc queries) 0 December 30th 04 06:55 AM
Count number of shaded cells Maddoktor Excel Discussion (Misc queries) 2 December 20th 04 08:35 PM
VBA Import of text file & Array parsing of that data Dennis Excel Discussion (Misc queries) 4 November 28th 04 10:20 PM


All times are GMT +1. The time now is 04:35 AM.

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"