View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default SUM() of empty dynamic named range returns #N/A

=sum() ignores text and empty cells.

So if you got an error from the =sum() function, that means that you have an
error in that range.

You could use an array formula:
=sum(if(isnumber(camperrev),camperrev))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

And camperrev can't refer to a whole column except in xl2007.

Or you could change the formula that is used in the cells in camperrev. Instead
of returning an error, you could return a 0 or an empty string ("").

Aviashn wrote:

I have a cell with =SUM(CamperRev) where CamperRev is a dynamically
named range containing contribution amounts. This works fine if there
are any contributions, but displays #N/A if there are not.

I worked around this with
=IF(ISNUMBER(SUM(CamperRev)),SUM(CamperRev),"") but was wondering if
there is a better way.


--

Dave Peterson