#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error

Is there any way to set a cell to 0 if any error(eg DIV/0 or VALUE
occurs

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Error

It depends what You are doing.
You may use IF function, for instance. Assuming that You want to divide
value in cell A2 by value in B2 You may write a following formula:
=IF(B2=0,0,A2/B2)
It will check if value in B2 equals 0 and if so return 0, if the opposite
return result of A2/B2.

"courtesio99" wrote in message
...
Is there any way to set a cell to 0 if any error(eg DIV/0 or VALUE)
occurs?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Error

Hi courtesio99!

Here's an example of the standard approach:

=IF(ISERROR(A1/A2),"",A1/A2)

But make sure that you are happy with the errors that you are hiding.
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia

Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
"courtesio99" wrote in
message ...
Is there any way to set a cell to 0 if any error(eg DIV/0 or VALUE)
occurs?


---
Message posted from
http://www.ExcelForum.com/



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
Excel 2007 - error saving file & error loading dll TinaF Excel Discussion (Misc queries) 0 July 1st 09 01:49 PM
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Error of slope taking into account error of the data points cer144 Excel Worksheet Functions 5 July 7th 08 07:26 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM


All times are GMT +1. The time now is 10:54 PM.

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

About Us

"It's about Microsoft Excel"