Hide #DIV/0! when there is a formula in the cell.

Ozhatch

Board Regular
Joined
Oct 31, 2011
Messages
65
Office Version
  1. 2007
Platform
  1. Windows
I've tried conditional formatting, and I'm unable to get this to work.

The cell contains this formula: =IF(H32="","", H32/E32). Obviously, when there is no value in E32, the sheet displays #DIV/0.

Please can somebody show me the formula for hiding the error message? I imagine it would begin with IFERROR; what after that?

Thanks in advance.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi,

How about:

=IF(OR(H32="",E32=""),"", H32/E32)
 
Upvote 0
Thank you both. Neither solution works; the error message is still visible.

However, based on your suggestions, I edited the formula to =IFERROR(IF(H32="","", H32/E32),"") Works perfectly!

:beerchug:
 
Upvote 0
Neither solution works; the error message is still visible.
In that case I'd suggest that E32 does not contain "no value". In a vacant cell if you put the formula =LEN(E32) what does it return?

If the error is still a #DIV/0! error then perhaps E32 contains a zero or a #DIV0 ! error itself and the cell has some custom or conditional formatting that is hiding the zero/error value?

If the error has changed to #VALUE ! then perhaps E32 contains a formula that is returning, say, a space character so the cell appears empty but is actually not?
 
Last edited:
Upvote 0
In that case I'd suggest that E32 does not contain "no value".

Thanks Peter; I hadn't thought of that. E32 does have a formula in it: =SUM(E4:E31).

The solution I cobbled together seems to do the job. And the learning is invaluable.

Much appreciated.
 
Upvote 0
So, in that case wouldn't
Code:
=IF(OR(H32=0,E32=0),"", H32/E32)

work ??
 
Upvote 0
Thanks Peter; I hadn't thought of that. E32 does have a formula in it: =SUM(E4:E31).

The solution I cobbled together seems to do the job.
It would & I don't really know anything about your worksheet or data, but in general terms your solution would also hide other errors that it might actually be better to know about.
For example, if E4:E31 contained another error (eg #N/A or #VALUE !) your solution would hide that & the user may just think that E32 contains zero.

This modified suggestion by jtakw for instance would deal with the zero in E32 but still make the user aware of other errors that may be in the data

=IF(OR(H32="",E32=0),"", H32/E32)

wwbwb's suggestion could have a similar modification and it may be that the H32 check should be for 0 instead of "" too?
 
Last edited:
Upvote 0
Thanks again, Peter. And thanks, too, to Michael M.

In my spreadsheet the values in E4:E31 are user-entries, i.e. dollar amounts. The cell under discussion calculates a discount percentage. Therefore there's little or no chance that a #N/A or #VALUE ! could appear.

I have no problem with seeing #DIV/0! in that cell; a couple of the less-tech-savvy users seem to think it's confusing. (Each user has her own spreadsheet to record sales.) That's why I've turned to you gurus for a solution.

Once again, thanks very much for all your input, and for Michael M's line: "The more I learn, the less I seem to know."


In "
The Four Stages of Learning" I'm trying to elevate to "Conscious Incompetence."

:)


 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top