Percentage equals 0 error

R

Richard Horn

I know if I ask for the percentage of =G44/H44 and both columns contain a 0,
or H44 contains a 0, Excel will return a #DIV/0! error. Is there anyway to
override that and display 0% until I actually get the numbers in there from a
database query I need to run, which may be later in the year?
 
D

David Biddulph

Can't you get away with just =IF(H44=0,0,G44/H44) ?
[Unless, of course, there is text in G44?]
 
T

T. Valko

Can't you get away with just =IF(H44=0,0,G44/H44) ?
[Unless, of course, there is text in G44?]

Yes, but you could also get away with just this if you wanted to:

=IF(H44,G44/H44,0)

That's why the first line in my reply was:

--
Biff
Microsoft Excel MVP


David Biddulph said:
Can't you get away with just =IF(H44=0,0,G44/H44) ?
[Unless, of course, there is text in G44?]
 
J

Joe User

T. Valko said:
Can't you get away with just =IF(H44=0,0,G44/H44) ?
[....]
Yes, but you could also get away with just this
if you wanted to:
=IF(H44,G44/H44,0)

That returns an error if H44 is the null string. I thought that might be
why you had included the COUNT condition. But the following covers both
adequately:

=IF(N(H44),N(G44)/H44,0)


----- original message -----

T. Valko said:
Can't you get away with just =IF(H44=0,0,G44/H44) ?
[Unless, of course, there is text in G44?]

Yes, but you could also get away with just this if you wanted to:

=IF(H44,G44/H44,0)

That's why the first line in my reply was:

--
Biff
Microsoft Excel MVP


David Biddulph said:
Can't you get away with just =IF(H44=0,0,G44/H44) ?
[Unless, of course, there is text in G44?]
--
David Biddulph


T. Valko said:
One way...

=IF(OR(H44=0,COUNT(G44:H44)<2),0,G44/H44)

--
Biff
Microsoft Excel MVP


I know if I ask for the percentage of =G44/H44 and both columns contain
a 0,
or H44 contains a 0, Excel will return a #DIV/0! error. Is there anyway
to
override that and display 0% until I actually get the numbers in there
from a
database query I need to run, which may be later in the year?
 
T

T. Valko

Good grief!

What part of "one way" don't you folks understand? <bg>

<bg> means "big grin". As in a big joking #$%^ eating grin.

--
Biff
Microsoft Excel MVP


Joe User said:
T. Valko said:
Can't you get away with just =IF(H44=0,0,G44/H44) ?
[....]
Yes, but you could also get away with just this
if you wanted to:
=IF(H44,G44/H44,0)

That returns an error if H44 is the null string. I thought that might be
why you had included the COUNT condition. But the following covers both
adequately:

=IF(N(H44),N(G44)/H44,0)


----- original message -----

T. Valko said:
Can't you get away with just =IF(H44=0,0,G44/H44) ?
[Unless, of course, there is text in G44?]

Yes, but you could also get away with just this if you wanted to:

=IF(H44,G44/H44,0)

That's why the first line in my reply was:
One way...

--
Biff
Microsoft Excel MVP


David Biddulph said:
Can't you get away with just =IF(H44=0,0,G44/H44) ?
[Unless, of course, there is text in G44?]
--
David Biddulph


One way...

=IF(OR(H44=0,COUNT(G44:H44)<2),0,G44/H44)

--
Biff
Microsoft Excel MVP


I know if I ask for the percentage of =G44/H44 and both columns contain
a 0,
or H44 contains a 0, Excel will return a #DIV/0! error. Is there
anyway to
override that and display 0% until I actually get the numbers in there
from a
database query I need to run, which may be later in the year?
 
J

Joe User

T. Valko said:
Good grief!
What part of "one way" don't you folks understand? <bg>

Next time I'll write "here's another way" or "here's an improvement" for
those who don't get that that is implicit as always. <bg>


----- original message -----

T. Valko said:
Good grief!

What part of "one way" don't you folks understand? <bg>

<bg> means "big grin". As in a big joking #$%^ eating grin.

--
Biff
Microsoft Excel MVP


Joe User said:
T. Valko said:
Can't you get away with just =IF(H44=0,0,G44/H44) ? [....]
Yes, but you could also get away with just this
if you wanted to:
=IF(H44,G44/H44,0)

That returns an error if H44 is the null string. I thought that might be
why you had included the COUNT condition. But the following covers both
adequately:

=IF(N(H44),N(G44)/H44,0)


----- original message -----

T. Valko said:
Can't you get away with just =IF(H44=0,0,G44/H44) ?
[Unless, of course, there is text in G44?]

Yes, but you could also get away with just this if you wanted to:

=IF(H44,G44/H44,0)

That's why the first line in my reply was:

One way...

--
Biff
Microsoft Excel MVP


"David Biddulph" <groups [at] biddulph.org.uk> wrote in message
Can't you get away with just =IF(H44=0,0,G44/H44) ?
[Unless, of course, there is text in G44?]
--
David Biddulph


One way...

=IF(OR(H44=0,COUNT(G44:H44)<2),0,G44/H44)

--
Biff
Microsoft Excel MVP


message I know if I ask for the percentage of =G44/H44 and both columns
contain a 0,
or H44 contains a 0, Excel will return a #DIV/0! error. Is there
anyway to
override that and display 0% until I actually get the numbers in
there from a
database query I need to run, which may be later in the year?
 

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

Similar Threads


Top