IF to return ""

Avalanchez

New Member
Joined
Jun 23, 2021
Messages
14
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Platform
  1. Windows
How do I add if this formula = 0 then the cell will be blank?

=IF(OR(D9>0),(SUM(((D8:D9)+(E8:E9))/2)),SUM((D8)+(E8)))

and same with this iferror return blank
=IF(OR(D9>0),(((AVERAGE(F8:F9))/SUM(((D8:D9)+(E8:E9))/2))),((F8))/((D8)+(E8)))
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Which version of Excel are you really using for this (for some reason, you seem to have them all listed in your profile, so we cannot tell which version you are currently using).
If Excel 365, I would make use of the new LET function, i.e.
Excel Formula:
=LET(x,IF(OR(D9>0),(SUM(((D8:D9)+(E8:E9))/2)),SUM((D8)+(E8))),IF(x=0,"",x))

Or if it just a visual thing, you could simply apply Custom formatting or Condiitonal Formatting to hide the zeroes, i.e. Display or hide zero values - Microsoft Support
 
Upvote 0
Which version of Excel are you really using for this (for some reason, you seem to have them all listed in your profile, so we cannot tell which version you are currently using).
If Excel 365, I would make use of the new LET function, i.e.
Excel Formula:
=LET(x,IF(OR(D9>0),(SUM(((D8:D9)+(E8:E9))/2)),SUM((D8)+(E8))),IF(x=0,"",x))

Or if it just a visual thing, you could simply apply Custom formatting or Condiitonal Formatting to hide the zeroes, i.e. Display or hide zero values - Microsoft Support
that works. Lets say i didnt have LET, how would I write that?
 
Upvote 0
You would have to double-up your equation, i.e. structure it like this:
Excel Formula:
=If(equation=0,"",equation)

By the way, I think the SUM in this part of your equation is redundant and unnecessary:
Excel Formula:
SUM((D8)+(E8)))

Either just use:
Excel Formula:
SUM(D8:E8)
or
Excel Formula:
D8+E8
No need for SUM and +, as they both do the same thing when only dealing with 2 cells!
 
Upvote 0

Forum statistics

Threads
1,215,403
Messages
6,124,710
Members
449,182
Latest member
mrlanc20

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