View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default #DIV/0! in variance/percentage formula

First, you don't need that =sum() function in your formula:

=if(b2=0,"",(a2-b2)/b2)

As long as those cells are numeric or empty.



Annette wrote:

I have tried to figure out how to write this formula so it will produce
either the correct result or show nothing.

Here is an example

2009 2008 % -/+
50.00 100.00 -0.5%
100 0 0%
0 100.00 -100%

I can write =if(sum(cell 1 - cell 2)/cell 2 = "", "", sum(cell 1 - cell
2)/cell 2))
The second row will display #DIV/0!

I would like the second row to display 0 ...

Can someone tell me how to write that formula? Thanks much!

Annette


--

Dave Peterson