cell formula question

R

Robert Crandal

I am using the following formula in one of my cells: "=C1 / D2".
The problem with this formula is that the result will be "#DIV/0!"
if cell D2 contains no data.

Can I somehow fix my formula so it does NOT return any value
if either C1 or D2 is empty? I just want to avoid situations when
the outuput of my formula is "#DIV/0!" or "#Value#" because it
just doesn't look pretty to me, hahah!

Thank you!
 
P

Peter T

Another way but only if all users have 2007+

=IFERROR(A1/B1,"")

in 97-2003 use ISERROR as suggested by jkrons

Regards,
Peter T

Actually

=IF(ISERROR(C1/D2;"";C1/D2)

is better
 
M

Mike H

Robert,

This will return a blank cell unless both cells have a number in

=IF(COUNT(C1,D2)=2,C1/D2,"")

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 

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