Cell doesn't stay 'blank' if I change the formula

leopardhawk

Well-known Member
Joined
May 31, 2007
Messages
611
Office Version
  1. 2016
Platform
  1. Windows
Hello forum friends, I have a cell (H20) with this formula in it.
Code:
=IFERROR(IF(H5>=H8,E15-E16,H6-H9,"")
Because none of the cells in the formula contain any data, cell H20 is blank, which is what I need it to be, I do not want a zero (0) in cell H20. However, I need to modify the formula ever so slightly and if I do, I end up with a zero (0) in cell H20! I am hoping someone can tell me why?

Here is the modified formula and again, none of the cells in the formula contain any data. You can see that all I did was change E15-E16 to H16-H17.
Code:
=IFERROR(IF(H5>=H8,H16-H17,H6-H9,"")

Thanks so much for any advice.
 

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.
Have you tried changing the format....

  1. Click the File menu and then choose Options (under Help). In Excel 2007, click the Office button and then click Excel Options. In Excel 2003, choose Options from the Tools menu.
  2. Choose Advanced in the left pane. In Excel 2003, click the View tab.
  3. In the Display Options For This Worksheet section, uncheck the Show A Zero In Cells That Have Zero Value.
  4. Click OK.
Then just use
=IF(H5>=H8,H16-H17,H6-H9)
 
Upvote 0
You won't get an error if the cells are blank so the ISERROR isn't really doing anything.

If you want to check for blank cells try something like this.

=IF(AND(H5="", H8="", E15="", E16="", H6="", H9=""), "", IF(H5>=H8,E15-E16,H6-H9))

P.S. You might not need to check every cell is blank.
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,204
Members
449,072
Latest member
DW Draft

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