View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Divide two cells and if the number is negative display is as zero

Hi Mike,

Following assumes that A1 is divided by B1

=IF(A1/B1<0,0,A1/B1)

However, if you have any zeros in column B then you will get #DIV/0! error
so you might want to expand the formula and put "" in lieu of the error.
=IF(ISERROR(A1/B1),"",IF(A1/B1<0,0,A1/B1))

If you want zero instead of "" if dividing by zero then replace the "" with
zero.
=IF(ISERROR(A1/B1),0,IF(A1/B1<0,0,A1/B1))


--
Regards,

OssieMac


"mike" wrote:

I have an excell spread sheet and i am dividing two cells. Most of the
numbers are positve but some of the numbers are negative. I want to put a
formula in to all the cells that will divide the two cells and give me the
answer to one digit but if the number is negative i want it to display as 0.