#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default divide by zero

If in cell c1 I have a formula =a1/b1 and either one or both are empty, how
do I check for that so as not to produce a divide by 0.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default divide by zero

The divide by zero error will only happen when B1 equals zero, so just test
for that condition. Unfortunately, you didn't say what you want to happen
for this condition, so I'll just show ??? in the cell (change that to
whatever you want)...

IF(B1=0,"???",A1/B1)

--
Rick (MVP - Excel)


"Meebers" wrote in message
...
If in cell c1 I have a formula =a1/b1 and either one or both are empty,
how do I check for that so as not to produce a divide by 0.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default divide by zero

=IF(B1=0,"",A1/B1)
--
David Biddulph

"Meebers" wrote in message
...
If in cell c1 I have a formula =a1/b1 and either one or both are empty,
how do I check for that so as not to produce a divide by 0.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default divide by zero

Tx Rick and David, yes I wanted "" in either condition. no data in A gives
me a "0" and no data in B gives me #DIV/0! My question should have been
"so as not to produce a "0" or #DIV/0!" In other places on the sheet, I
want a 0 (zero) and therefore opting for do not show 0 values was not
chosen. TIA

"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
=IF(B1=0,"",A1/B1)
--
David Biddulph

"Meebers" wrote in message
...
If in cell c1 I have a formula =a1/b1 and either one or both are empty,
how do I check for that so as not to produce a divide by 0.





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default divide by zero

For your revised question, try
=IF(OR(B1=0,A1=""),"",A1/B1)

I assume that if you have a zero in A you want to show zero for the result,
but if you have a blank in A you want a blank result?
--
David Biddulph

"Meebers" wrote in message
...
Tx Rick and David, yes I wanted "" in either condition. no data in A
gives me a "0" and no data in B gives me #DIV/0! My question should have
been "so as not to produce a "0" or #DIV/0!" In other places on the
sheet, I want a 0 (zero) and therefore opting for do not show 0 values was
not chosen. TIA

"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
=IF(B1=0,"",A1/B1)
--
David Biddulph

"Meebers" wrote in message
...
If in cell c1 I have a formula =a1/b1 and either one or both are empty,
how do I check for that so as not to produce a divide by 0.









  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default divide by zero

Then it sounds like you want this formula...

=IF(OR(A1=0,B1=0),"",A1/B1)

--
Rick (MVP - Excel)


"Meebers" wrote in message
...
Tx Rick and David, yes I wanted "" in either condition. no data in A
gives me a "0" and no data in B gives me #DIV/0! My question should have
been "so as not to produce a "0" or #DIV/0!" In other places on the
sheet, I want a 0 (zero) and therefore opting for do not show 0 values was
not chosen. TIA

"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
=IF(B1=0,"",A1/B1)
--
David Biddulph

"Meebers" wrote in message
...
If in cell c1 I have a formula =a1/b1 and either one or both are empty,
how do I check for that so as not to produce a divide by 0.






  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default divide by zero

Thanks to both...you get extra points!

"Rick Rothstein" wrote in message
...
Then it sounds like you want this formula...

=IF(OR(A1=0,B1=0),"",A1/B1)

--
Rick (MVP - Excel)


"Meebers" wrote in message
...
Tx Rick and David, yes I wanted "" in either condition. no data in A
gives me a "0" and no data in B gives me #DIV/0! My question should
have been "so as not to produce a "0" or #DIV/0!" In other places on the
sheet, I want a 0 (zero) and therefore opting for do not show 0 values
was not chosen. TIA

"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
=IF(B1=0,"",A1/B1)
--
David Biddulph

"Meebers" wrote in message
...
If in cell c1 I have a formula =a1/b1 and either one or both are empty,
how do I check for that so as not to produce a divide by 0.








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
Divide By help? kirstie adam Excel Worksheet Functions 2 December 5th 06 04:23 PM
divide by zero chiuinggum Excel Worksheet Functions 1 April 8th 06 09:52 AM
divide by 0 sony654 Excel Worksheet Functions 4 April 24th 05 08:10 AM
Divide by Zero rocky Excel Worksheet Functions 3 April 22nd 05 12:50 PM
Divide one row over other row I dont wont to divide one number Rick Excel Discussion (Misc queries) 0 March 4th 05 07:13 PM


All times are GMT +1. The time now is 04:48 PM.

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"