I would like to be able to use in my formula zero divided by zero (which is zero).  I need this in order for my P

I would like to expand briefly on my submitted question.  I developed a spread sheet to monitor profit and loss on stocks that I trade.  My P & L column currently displays the negative value of my purchase(s).  I created a formula that includes my exit price of the stock which is zero until I sell some shares.  I would like my P & L column to show a correct value and then of course total the column.  I was able to create a formula that is mathematically correct using a variable divided by itself to give me a correct display but Numbers wouldn't allow it because sometimes that variable is equal to zero until I sell some shares of the stock and then the sell price gets plugged in.  If that variable is any number besides zero then obviously the formula will be multiplying by one (1) and that will show me a correct value in my P & L column.  Any suggestions or ideas?  Please advise.  Thanks carjam.

0 / 0 is not defined.  It is NOT equal to zero.  it is a special case which you should avoid.  If you have questions about the details of dividing by zero refer to here:
http://en.wikipedia.org/wiki/Zero_divided_by_zero
you may want to perform the divide only if the dividend is not zero or maks the error using the function iferror()
something like:
=iferror(A1/B1, 0)
this will attempt to divide A1 by B1 and return the result.  if there is an error then the function will return zero

Similar Messages

Maybe you are looking for