A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#DIV/O! Error



 
 
Thread Tools Display Modes
  #1  
Old March 16th, 2009, 10:34 PM posted to microsoft.public.excel.worksheet.functions
Chris
external usenet poster
 
Posts: 50
Default #DIV/O! Error

I would like to be abe to have the #DIV/O! error show "N/A" when this
formula does not find any values to calculate. Due to another program
I am using along with excel, I cannot use ISERROR or ISERR. I know
that there are more effecient ways of writing the formula but I am
restricted to what is shown.

=(SUMIF($A$23:$A$361,A4,$L$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A
$23:$A$361,A4,$M$23:$M$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A
$361,A4,$N$23:$N$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O
$23:$O$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P
$361)/COUNTIF($A$23:$A$361,A4))/5

I tried using
=IF(SUMIF($A$23:$A$361,A4,$L$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF
($A$23:$A$361,A4,$M$23:$M$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A
$361,A4,$N$23:$N$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O
$23:$O$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P
$361)/COUNTIF($A$23:$A$361,A4)/5=0,"N/A",(SUMIF($A$23:$A$361,A4,$L
$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$M$ 23:$M
$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$N$ 23:$N$361)/
COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O$ 23:$O$361)/COUNTIF($A
$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$23:$P$361)/COUNTIF($A$23:$A
$361,A4))/5)

But I still get the #DIV/0!
  #2  
Old March 17th, 2009, 02:45 AM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default #DIV/O! Error

Your divisor is the same in all instances so all you need to do is test and
make sure there is a result 0 from your COUNTIF:

=IF(COUNTIF($A$23:$A$361,A4)=0,"N/A",SUMIF(......)/5)

--
Biff
Microsoft Excel MVP


"Chris" wrote in message
...
I would like to be abe to have the #DIV/O! error show "N/A" when this
formula does not find any values to calculate. Due to another program
I am using along with excel, I cannot use ISERROR or ISERR. I know
that there are more effecient ways of writing the formula but I am
restricted to what is shown.

=(SUMIF($A$23:$A$361,A4,$L$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A
$23:$A$361,A4,$M$23:$M$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A
$361,A4,$N$23:$N$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O
$23:$O$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P
$361)/COUNTIF($A$23:$A$361,A4))/5

I tried using
=IF(SUMIF($A$23:$A$361,A4,$L$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF
($A$23:$A$361,A4,$M$23:$M$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A
$361,A4,$N$23:$N$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O
$23:$O$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P
$361)/COUNTIF($A$23:$A$361,A4)/5=0,"N/A",(SUMIF($A$23:$A$361,A4,$L
$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$M$ 23:$M
$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$N$ 23:$N$361)/
COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O$ 23:$O$361)/COUNTIF($A
$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$23:$P$361)/COUNTIF($A$23:$A
$361,A4))/5)

But I still get the #DIV/0!



  #3  
Old March 17th, 2009, 03:13 AM posted to microsoft.public.excel.worksheet.functions
OssieMac
external usenet poster
 
Posts: 862
Default #DIV/O! Error

Hi Chris,

I suspect that you have more than 1 divisor that = Zero.

Try using an out of the way range of your worksheet and insert all of your
divisor formulas something like the following. (Example uses Z1:Z5 but can
use any range).

Z1 = COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$M$ 23:$M$361)
Z2 = COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$N$ 23:$N$361)
Z3 = COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O$ 23:$O$361)
Z4 = COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P$361)
Z5 = COUNTIF($A$23:$A$361,A4))

Then in your formula you can test for any of the divisors equal to zero with
the countif function. If no divisors equal zero then your formula else "N/A".

Untested but I think it should then be something like this:-

=IF(COUNTIF($Z$1:$Z$5,0) = 0,
(SUMIF($A$23:$A$361,A4,$L$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A
$23:$A$361,A4,$M$23:$M$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A
$361,A4,$N$23:$N$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O
$23:$O$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P
$361)/COUNTIF($A$23:$A$361,A4))/5, "N/A")

I'll be interested to see if it works.

--
Regards,

OssieMac


"Chris" wrote:

I would like to be abe to have the #DIV/O! error show "N/A" when this
formula does not find any values to calculate. Due to another program
I am using along with excel, I cannot use ISERROR or ISERR. I know
that there are more effecient ways of writing the formula but I am
restricted to what is shown.

=(SUMIF($A$23:$A$361,A4,$L$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A
$23:$A$361,A4,$M$23:$M$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A
$361,A4,$N$23:$N$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O
$23:$O$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P
$361)/COUNTIF($A$23:$A$361,A4))/5

I tried using
=IF(SUMIF($A$23:$A$361,A4,$L$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF
($A$23:$A$361,A4,$M$23:$M$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A
$361,A4,$N$23:$N$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O
$23:$O$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P
$361)/COUNTIF($A$23:$A$361,A4)/5=0,"N/A",(SUMIF($A$23:$A$361,A4,$L
$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$M$ 23:$M
$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$N$ 23:$N$361)/
COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O$ 23:$O$361)/COUNTIF($A
$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$23:$P$361)/COUNTIF($A$23:$A
$361,A4))/5)

But I still get the #DIV/0!

  #4  
Old March 17th, 2009, 03:51 AM posted to microsoft.public.excel.worksheet.functions
OssieMac
external usenet poster
 
Posts: 862
Default #DIV/O! Error

Hi again Chris,

Disregard my answer. Obviously Biff was answering around the same time that
I was and when his answer arrived I realized that I had not studied the
formula sufficiently well enough. The part after the + sign is not part of
the divisor.

--
Regards,

OssieMac


"OssieMac" wrote:

Hi Chris,

I suspect that you have more than 1 divisor that = Zero.

Try using an out of the way range of your worksheet and insert all of your
divisor formulas something like the following. (Example uses Z1:Z5 but can
use any range).

Z1 = COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$M$ 23:$M$361)
Z2 = COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$N$ 23:$N$361)
Z3 = COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O$ 23:$O$361)
Z4 = COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P$361)
Z5 = COUNTIF($A$23:$A$361,A4))

Then in your formula you can test for any of the divisors equal to zero with
the countif function. If no divisors equal zero then your formula else "N/A".

Untested but I think it should then be something like this:-

=IF(COUNTIF($Z$1:$Z$5,0) = 0,
(SUMIF($A$23:$A$361,A4,$L$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A
$23:$A$361,A4,$M$23:$M$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A
$361,A4,$N$23:$N$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O
$23:$O$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P
$361)/COUNTIF($A$23:$A$361,A4))/5, "N/A")

I'll be interested to see if it works.

--
Regards,

OssieMac


"Chris" wrote:

I would like to be abe to have the #DIV/O! error show "N/A" when this
formula does not find any values to calculate. Due to another program
I am using along with excel, I cannot use ISERROR or ISERR. I know
that there are more effecient ways of writing the formula but I am
restricted to what is shown.

=(SUMIF($A$23:$A$361,A4,$L$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A
$23:$A$361,A4,$M$23:$M$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A
$361,A4,$N$23:$N$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O
$23:$O$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P
$361)/COUNTIF($A$23:$A$361,A4))/5

I tried using
=IF(SUMIF($A$23:$A$361,A4,$L$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF
($A$23:$A$361,A4,$M$23:$M$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A
$361,A4,$N$23:$N$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O
$23:$O$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P
$361)/COUNTIF($A$23:$A$361,A4)/5=0,"N/A",(SUMIF($A$23:$A$361,A4,$L
$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$M$ 23:$M
$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$N$ 23:$N$361)/
COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O$ 23:$O$361)/COUNTIF($A
$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$23:$P$361)/COUNTIF($A$23:$A
$361,A4))/5)

But I still get the #DIV/0!

  #5  
Old March 17th, 2009, 09:25 PM posted to microsoft.public.excel.worksheet.functions
Chris
external usenet poster
 
Posts: 50
Default #DIV/O! Error

On Mar 16, 6:45*pm, "T. Valko" wrote:
Your divisor is the same in all instances so all you need to do is test and
make sure there is a result 0 from your COUNTIF:

=IF(COUNTIF($A$23:$A$361,A4)=0,"N/A",SUMIF(......)/5)

--
Biff
Microsoft Excel MVP

"Chris" wrote in message

...



I would like to be abe to have the #DIV/O! error show "N/A" when this
formula does not find any values to calculate. Due to another program
I am using along with excel, I cannot use ISERROR or ISERR. I know
that there are more effecient ways of writing the formula but I am
restricted to what is shown.


=(SUMIF($A$23:$A$361,A4,$L$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A
$23:$A$361,A4,$M$23:$M$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A
$361,A4,$N$23:$N$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O
$23:$O$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P
$361)/COUNTIF($A$23:$A$361,A4))/5


I tried using
=IF(SUMIF($A$23:$A$361,A4,$L$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF
($A$23:$A$361,A4,$M$23:$M$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A
$361,A4,$N$23:$N$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O
$23:$O$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P
$361)/COUNTIF($A$23:$A$361,A4)/5=0,"N/A",(SUMIF($A$23:$A$361,A4,$L
$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$M$ 23:$M
$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$N$ 23:$N$361)/
COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O$ 23:$O$361)/COUNTIF($A
$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$23:$P$361)/COUNTIF($A$23:$A
$361,A4))/5)


But I still get the #DIV/0!- Hide quoted text -


- Show quoted text -


Thanks - this works great!
  #6  
Old March 17th, 2009, 09:42 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default #DIV/O! Error

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Chris" wrote in message
...
On Mar 16, 6:45 pm, "T. Valko" wrote:
Your divisor is the same in all instances so all you need to do is test
and
make sure there is a result 0 from your COUNTIF:

=IF(COUNTIF($A$23:$A$361,A4)=0,"N/A",SUMIF(......)/5)

--
Biff
Microsoft Excel MVP

"Chris" wrote in message

...



I would like to be abe to have the #DIV/O! error show "N/A" when this
formula does not find any values to calculate. Due to another program
I am using along with excel, I cannot use ISERROR or ISERR. I know
that there are more effecient ways of writing the formula but I am
restricted to what is shown.


=(SUMIF($A$23:$A$361,A4,$L$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A
$23:$A$361,A4,$M$23:$M$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A
$361,A4,$N$23:$N$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O
$23:$O$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P
$361)/COUNTIF($A$23:$A$361,A4))/5


I tried using
=IF(SUMIF($A$23:$A$361,A4,$L$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF
($A$23:$A$361,A4,$M$23:$M$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A
$361,A4,$N$23:$N$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O
$23:$O$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$ 23:$P
$361)/COUNTIF($A$23:$A$361,A4)/5=0,"N/A",(SUMIF($A$23:$A$361,A4,$L
$23:$L$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$M$ 23:$M
$361)/COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$N$ 23:$N$361)/
COUNTIF($A$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$O$ 23:$O$361)/COUNTIF($A
$23:$A$361,A4)+SUMIF($A$23:$A$361,A4,$P$23:$P$361)/COUNTIF($A$23:$A
$361,A4))/5)


But I still get the #DIV/0!- Hide quoted text -


- Show quoted text -


Thanks - this works great!


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:44 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.