Divide two cells and if the number is negative display is as zero
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. |
Divide two cells and if the number is negative display is as zero
Maybe something like this...
=MAX(0,ROUND(A1/A2,1)) -- Biff Microsoft Excel MVP "mike" wrote in message ... 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. |
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. |
All times are GMT +1. The time now is 12:56 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com