Result a blank cell

EmmaTM

Board Regular
Joined
Jan 5, 2022
Messages
74
Office Version
  1. 365
Platform
  1. Windows
Hi,
I am using the following formula in columns E&F:
=(SUMIF($H18,">0"))

But if it results zero I want the cell to remain blank, how do I do this?

Thank you

1641827339119.png
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
One way:
Excel Formula:
=IF(SUMIF($H18,">0")=0,"",SUMIF($H18,">0"))
 
Upvote 0
Thank you, that worked perfectly for column E.
I used the same in column F and swapped > for <
=IF(SUMIF($H18,"<0")=0,"",SUMIF($H18,"<0")) but I want the numbers in column F to be positive as the previous screenshot. So F18 should be 9,590.63 not -9,590.63.

thank you

1641832211591.png
 
Upvote 0
Actually, in looking at this closer, I failed to notice you are only checking one cell at a time. So you do not need SUMIF. That is typically used for multi-cell ranges.

So instead of this:
Excel Formula:
=IF(SUMIF($H18,">0")=0,"",SUMIF($H18,">0"))
you can just us this:
Excel Formula:
=IF($H18>0,$H18,"")

Then for your other column, just use the same logic, but multiply by -1, i.e.
Excel Formula:
=IF($H18<0,$H18*-1,"")
 
Upvote 0
Solution
Another option still:

You can use a simpler formula, i.e.
for column E:
Excel Formula:
=MAX($H18,0)
for column F:
Excel Formula:
=MIN($H18,0)*-1
and then simply apply the following Custom Number format to columns E and F to hide the zeroes:
0;-0;;@

If you aren't sure how to do that last part, check out the "Hide zero values in selected cells" section here: Display or hide zero values
 
Upvote 0
Actually, in looking at this closer, I failed to notice you are only checking one cell at a time. So you do not need SUMIF. That is typically used for multi-cell ranges.

So instead of this:
Excel Formula:
=IF(SUMIF($H18,">0")=0,"",SUMIF($H18,">0"))
you can just us this:
Excel Formula:
=IF($H18>0,$H18,"")

Then for your other column, just use the same logic, but multiply by -1, i.e.
Excel Formula:
=IF($H18<0,$H18*-1,"")
Amazing, thank you
 
Upvote 0

Forum statistics

Threads
1,214,391
Messages
6,119,247
Members
448,879
Latest member
oksanana

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