View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.misc
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Getting #DIV/0!, how to get 0%?

You can't "show a % of increase", since it's mathematically undefined,
but you can show a default value:

=IF(C37=0, "undefined", J37/C37 - 1)

or

=IF(C37=0, 1, J37/C37 - 1)



In article ,
kaimarja wrote:

Hi David, Thanks for the reply. Sorry for not being specific enough. Here are
the answers to your questions:

I use the formula =(J37-C37)/ABS(C37), C being last years value and J being
this years value.
The value in C37 is 0 and the value in J37 is 70 .
The result cell is formatted to give a % and in all the other result cells
when the formula does not refer to cells containing 0, I get a correct answer
but not in the above case, where last year's cell contains a 0. The result
shows as #DIV/0!

What I want is that when last year I had 0 and this year I have 70, the
result of my formula should show a % of increase.
I tried to copy and paste the formula you propose in your answer, but I
still get an error message from excel "The formula you typed contains an
error".

Of course I understand I'm asking my formula to calculate a % of 0, which is
illogical, but I wondered whether there was a way around it.