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

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
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,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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