If isblank or equals zero

Asw091

New Member
Joined
May 28, 2017
Messages
24
Hi guys,

I hope you can help,

I’m trying to achieve something here that I just can’t seem to get my head around.

I want it to work out what i8/i7 is, but only if both of them have a value. I have a working formula for that. =IF(OR(ISBLANK(I7),ISBLANK(I8)),,I8/I7)

However when they’re both showing 0, it returns #DIV/0! Because it can’t divide two zeros.

How can I put if I7 or I8 is blank or if I7+I8=0, ignore the formula otherwise do I8/I7?

Ultimately, I would like a formula that says if either cell is blank show 0, if the sum of both are equal to or less than 0, show 0, if they total more than 0, show the number.

Is this possible or am I asking too much?

I hope this makes sense.

Any help would be greatly appreciated.

Thanks.
 

Some videos you may like

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

Trebor76

Well-known Member
Joined
Jul 23, 2007
Messages
4,597
Hi Asw091,

Here's two possibilities, I'm sure there's more:

=IF(OR(ISNUMBER(I7)=FALSE,ISNUMBER(I8)=FALSE),0,I8/I7)
=IFERROR(I8/I7,0)

HTH

Robert
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
35,939
Office Version
2010
Platform
Windows
It is the bottom number that cannot be 0 (dividing by 0 is undefined)... the top number is immaterial. So you might consider doing it this way...

=IF(I7=0,"",I8/I7)
 
Last edited:

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
12,693
Office Version
365, 2010
Platform
Windows, Mobile
Ultimately, I would like a formula that says if either cell is blank show 0, if the sum of both are equal to or less than 0, show 0, if they total more than 0, show the number.
Another possibility maybe...

<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>I</th><th>J</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">7</td><td style="text-align: right;;">-2</td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">8</td><td style="text-align: right;;">8</td><td style="text-align: right;color: #333333;;">0</td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet2</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">J8</th><td style="text-align:left">=IFERROR(<font color="Blue">IF(<font color="Red">OR(<font color="Green">ISBLANK(<font color="Purple">I7</font>),ISBLANK(<font color="Purple">I8</font>)</font>),0,IF(<font color="Green">I8/I7>0,I8/I7,0</font>)</font>),0</font>)</td></tr></tbody></table></td></tr></table><br />
 

Watch MrExcel Video

Forum statistics

Threads
1,099,754
Messages
5,470,576
Members
406,707
Latest member
drkjz

This Week's Hot Topics

Top