View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default Help with formula (IF)

=IF(B11=0;IF(A11=0;"undefined";-100%);IF(A11=0;100%;(B11-A11)/A11))

I don't know where you get your (B11/A11)/B11 from, but in my book it should
be (B11-A11)/A11
A change from 100 to 200 is a 100% increase. With your formula it would be
a 1% increase.

I've also removed the quotes around your 100% and -100%, as I assume you
want numbers rather than text.

Note also that if you've defined a change from 0 to 2 (or to any other
value) as a 100% change, you haven't distinguished between that and a change
from 1 to 2. And a change from 0 to 3 comes out at half the value of a
change from 1 to 3.

You may wish to rethink?
--
David Biddulph

"Gmaz" wrote in message
...
I have simple task to calculate % between two numbers:

A B %
1 2 +50%
2 1 -50%
1 1 0%

No problem until I dont get 0 as value in columns. Now I have found
solution to solve if A is 0, or if B is 0, but what to do if both values
are 0, because I got error sign and my table must be "clean".

=IF(B11=0;"-100%";IF(A11=0;"100%";(B11/A11)/B11))

This is what I have on right now but for both values 0 I get -100% instead
of 0.

Thank you in advance.