ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error in Formula (https://www.excelbanter.com/excel-programming/336506-error-formula.html)

Nigel

Error in Formula
 
I am trying to add this formula in a cell to get rid of a div/0 error but it
won't let me add it

=IF(L4=0,0,IF(L20=0,0,if(l4=0 and l20=0,0,(L4-L20)/L4)))

it doesn't like the statement if(l4=0 and l20=0,0 is there anyway to
easily get rid of div/0 error

thanks

K Dales[_2_]

Error in Formula
 
=IF(L4=0,0,IF(L20=0,0,if(AND(l4=0, l20=0),0,(L4-L20)/L4)))


--
- K Dales


"Nigel" wrote:

I am trying to add this formula in a cell to get rid of a div/0 error but it
won't let me add it

=IF(L4=0,0,IF(L20=0,0,if(l4=0 and l20=0,0,(L4-L20)/L4)))

it doesn't like the statement if(l4=0 and l20=0,0 is there anyway to
easily get rid of div/0 error

thanks


Rob

Error in Formula
 
Nigel,

have you tried:

=IF(L4=0,0,IF(L20=0,0,IF(L4=0 + L20=0,0,(L4-L20)/L4)))

regards, Rob.

"Nigel" wrote:

I am trying to add this formula in a cell to get rid of a div/0 error but it
won't let me add it

=IF(L4=0,0,IF(L20=0,0,if(l4=0 and l20=0,0,(L4-L20)/L4)))

it doesn't like the statement if(l4=0 and l20=0,0 is there anyway to
easily get rid of div/0 error

thanks


Tom Ogilvy

Error in Formula
 
=If(L4<0,(L4-L20)/L4,0)

only the denominator needs to be checked.

If you wanted to check both

=If(And(L4<0,L20<0),(L4-L20)/L4,0)

--
Regards,
Tom Ogilvy




"Nigel" wrote in message
...
I am trying to add this formula in a cell to get rid of a div/0 error but

it
won't let me add it

=IF(L4=0,0,IF(L20=0,0,if(l4=0 and l20=0,0,(L4-L20)/L4)))

it doesn't like the statement if(l4=0 and l20=0,0 is there anyway to
easily get rid of div/0 error

thanks





All times are GMT +1. The time now is 10:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com