Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF formula returns error; abbreviating the formula MZ Excel Discussion (Misc queries) 4 January 7th 10 11:02 PM
Error in Formula ?? Corey Excel Worksheet Functions 5 August 3rd 06 04:23 AM
How do I replace "#N/A" error, to continue my formula w/o error? Ali Khan Excel Worksheet Functions 2 February 20th 06 03:49 PM
#REF error in formula DanBal Excel Discussion (Misc queries) 3 August 12th 05 07:14 PM
Formula error with Mac resulting in '#NAME' error Linking to specific cells in pivot table Excel Programming 2 August 1st 05 07:13 AM


All times are GMT +1. The time now is 12:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"