Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-28-2016, 06:41 PM
jparnold jparnold is offline How to prevent #DIV/0! Windows XP How to prevent #DIV/0! Office 2010 32bit
Novice
How to prevent #DIV/0!
 
Join Date: Jan 2012
Location: Blue Mountains, NSW, Australia
Posts: 25
jparnold is on a distinguished road
Default How to prevent #DIV/0!

I am wondering how to insert a formula into a cell which will display a blank result when the values in the cells being accessed are blank.

For example I have formula of =F4/C4*100 which displays #DIV/0! when (cells) F4 and or C4 are blank.



Thanks
Reply With Quote
  #2  
Old 05-28-2016, 09:53 PM
macropod's Avatar
macropod macropod is offline How to prevent #DIV/0! Windows 7 64bit How to prevent #DIV/0! Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
=IF(C4=0,"",F4/C4*100)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-29-2016, 03:07 AM
jparnold jparnold is offline How to prevent #DIV/0! Windows XP How to prevent #DIV/0! Office 2010 32bit
Novice
How to prevent #DIV/0!
 
Join Date: Jan 2012
Location: Blue Mountains, NSW, Australia
Posts: 25
jparnold is on a distinguished road
Default

Thanks
If should have known better. I used to be an analyst/programmer and forgot about logical functions.
I note that the function VAL is not in Excel.
When a cell is blank and the cell is formatted as a number (this occurs when you initially format it as a number) how can you test if the cell contains nothing (ie blank) rather than containing the value zero - actually can you test if the cell is blank OR zero?
Reply With Quote
  #4  
Old 05-29-2016, 03:33 AM
Philb1 Philb1 is offline How to prevent #DIV/0! Windows 10 How to prevent #DIV/0! Office 2010 32bit
Advanced Beginner
 
Join Date: Feb 2016
Location: Auckland
Posts: 43
Philb1 is on a distinguished road
Default

This will do that
=IF(ISBLANK(A1),"It's Blank","It's Not Blank")
Reply With Quote
  #5  
Old 05-29-2016, 06:45 AM
jeffreybrown jeffreybrown is offline How to prevent #DIV/0! Windows Vista How to prevent #DIV/0! Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Try...

=IF(N(C4),F4/C4*100,"")
Reply With Quote
  #6  
Old 05-31-2016, 06:40 PM
jparnold jparnold is offline How to prevent #DIV/0! Windows XP How to prevent #DIV/0! Office 2010 32bit
Novice
How to prevent #DIV/0!
 
Join Date: Jan 2012
Location: Blue Mountains, NSW, Australia
Posts: 25
jparnold is on a distinguished road
Default

Lovely!
Works just the way I prefer. If the input cells contain nothing (clear), or a space or zero (0) then it returns a blank (ie clear)
I have not seen that logical operator before ie N()
Please explain.
Thanks again
John
Reply With Quote
  #7  
Old 05-31-2016, 07:39 PM
jeffreybrown jeffreybrown is offline How to prevent #DIV/0! Windows Vista How to prevent #DIV/0! Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Hi John,

Glad you have something to work with and you're welcome.

Maybe this will help

http://www.excelfunctions.net/Excel-N-Function.html
Reply With Quote
  #8  
Old 05-31-2016, 07:52 PM
jparnold jparnold is offline How to prevent #DIV/0! Windows 7 64bit How to prevent #DIV/0! Office 2010 32bit
Novice
How to prevent #DIV/0!
 
Join Date: Jan 2012
Location: Blue Mountains, NSW, Australia
Posts: 25
jparnold is on a distinguished road
Default

Thanks heaps.
Reply With Quote
  #9  
Old 06-28-2016, 06:52 PM
Mlguazzelli Mlguazzelli is offline How to prevent #DIV/0! Windows XP How to prevent #DIV/0! Office 2010 64bit
Novice
 
Join Date: Jun 2016
Location: Brazil
Posts: 1
Mlguazzelli is on a distinguished road
Default

What about

=iferror(F4/C4*100,0)

?
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
prevent repetition in form johnbest Word VBA 2 03-31-2015 11:42 PM
How to prevent #DIV/0! Prevent Copying and Pasting Jimmy Tsawo Excel 3 02-20-2014 03:54 AM
How to prevent #DIV/0! How can I PREVENT headings I don't want? peytontodd Word 3 11-23-2013 05:08 PM
Prevent Overlap of Appointments irab88 Outlook 0 08-03-2010 10:43 AM
text box, prevent from printing Tanya Word 0 02-05-2010 06:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft