I need the cell to read 0

P

Peter

I have this formula =SUM(AM3/G3) I need the cell to read zero, right now it
gives me a #div!
 
S

Sandy Mann

Try:

=IF(G3=0,0,AM3/G3)

Note: no need for the SUM() function.

or:

=IF(G3=0,"",AM3/G3)

To return an empty looking cell instead of a zero.

If there is any chance that G3 may contain an empty string, (from a formula)
then use:

=IF(OR(G3=0,G3=""),"",AM3/G3)

HTH

Sandy

In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
P

Peter

That worked thanks, it helped alot. However what if I have a formula that
reads =(e34+h34)/j26. How do I get the ) in that formula?
 
S

Sandy Mann

I don't understand what you mean by:
reads =(e34+h34)/j26. How do I get the ) in that formula?

) ??


--
Regards

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
P

Peter

I have the formula
=(e34+h34)/j26
it gives me the #div0! error.
I want it to read 0
 
G

Gord Dibben

muddan

ISERROR will hide all errors and would also hide a #VALUE! error if G3 contained
a <space>

OP wants just the #DIV0! trapped.

See Sandy's suggestions.


Gord Dibben MS Excel MVP
 
S

Sandy Mann

Just the same as before:

=IF(J26=0,0,(E34+H34)/J26)

or:

=IF(OR(J26=0,J26=""),"",(E34+H34)/J26)

depending of what may be in J26. If only ever a BLANK cell or a number then
the first one. If J26 *may* contain an empty string, (for instance if J26
had a forrmula like: =IF(J16="","",10) which will return "" or 10) then use
the second one.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
P

Peter

Thanks everyone it helped!!!

Gord Dibben said:
muddan

ISERROR will hide all errors and would also hide a #VALUE! error if G3 contained
a <space>

OP wants just the #DIV0! trapped.

See Sandy's suggestions.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top