Cell to remain blank if value is 0

tdog72

New Member
Joined
Aug 25, 2015
Messages
13
Good afternoon. I'm looking for some help with an IF statement. My formula is =sum(k2:k13)/sum(j2:j13). If the result of this is zero I want the cell left blank so it will not produce a div/0 error when I link the cell to another spread sheet. Can you help me please?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi,

You can wrap your formula with IFERROR:

Code:
=IFERROR(SUM(K2:K13)/SUM(J2:J13),"")
 
Upvote 0
IFERROR won't return blank for 0 if the problem is not in the denominator. (Say, the sum of K2:K13 was 0, but the sum of J2:J13 was 7)
However referencing a cell with "" will cause a #VALUE ! error if you do math with that result.

In General, you want to check for a 0 denominator:
=IF(SUM(J2:J13),SUM(K2:K13)/SUM(J2:J13),"")

Then you're next formula needs to check for the value in that cell before you do math on it.

But to incorporate that into what you asked:
=IF(SUM(J2:J13),IF(SUM(K2:K13)/SUM(J2:J13)=0,"",SUM(K2:K13)/SUM(J2:J13)),"")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,432
Messages
6,119,468
Members
448,900
Latest member
Fairooza

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