#1   Report Post  
PW11111
 
Posts: n/a
Default COUNTIF - #DIV/01


Hi

I have the following formula -

=COUNTIF(StatusCheck, "Snag Item")/COUNTIF(ElementCount,"Main Contractor -
Builderswork")

StatusCheck and ElementCount are named ranges.

The formula works - however when nothing is entered on the spreadsheet (the
formula has nothing to count) it displays #DIV/01.

Is there anything I can add to the formula to stop this happening?

Any help would be great.

Cheers,

Phil
  #2   Report Post  
aristotle
 
Posts: n/a
Default

Hi, this dhould do it...

=IF(ISERROR(COUNTIF(StatusCheck, "Snag Item")/COUNTIF(ElementCount,"Main
Contractor - Builderswork")),0,COUNTIF(StatusCheck, "Snag
Item")/COUNTIF(ElementCount,"Main Contractor - Builderswork"))


--
We are what we repeatedly do. Excellence, therefore, is not an act, but a
habit.


"PW11111" wrote:


Hi

I have the following formula -

=COUNTIF(StatusCheck, "Snag Item")/COUNTIF(ElementCount,"Main Contractor -
Builderswork")

StatusCheck and ElementCount are named ranges.

The formula works - however when nothing is entered on the spreadsheet (the
formula has nothing to count) it displays #DIV/01.

Is there anything I can add to the formula to stop this happening?

Any help would be great.

Cheers,

Phil

  #3   Report Post  
PW11111
 
Posts: n/a
Default


Hi

It does now return 0 instead of #DIV/01 - however it has stoped counting the
Main Contractor - Builderswork string. In otherwords its now always 0.!

Any ideas?

Thanks for the help.

Phil

"PW11111" wrote:


Hi

I have the following formula -

=COUNTIF(StatusCheck, "Snag Item")/COUNTIF(ElementCount,"Main Contractor -
Builderswork")

StatusCheck and ElementCount are named ranges.

The formula works - however when nothing is entered on the spreadsheet (the
formula has nothing to count) it displays #DIV/01.

Is there anything I can add to the formula to stop this happening?

Any help would be great.

Cheers,

Phil

  #4   Report Post  
aristotle
 
Posts: n/a
Default

Really? IF(ISERROR()) should only supress errors. Can you give me an
example of the data values that should present a count other than 0?



"PW11111" wrote:


Hi

It does now return 0 instead of #DIV/01 - however it has stoped counting the
Main Contractor - Builderswork string. In otherwords its now always 0.!

Any ideas?

Thanks for the help.

Phil

"PW11111" wrote:


Hi

I have the following formula -

=COUNTIF(StatusCheck, "Snag Item")/COUNTIF(ElementCount,"Main Contractor -
Builderswork")

StatusCheck and ElementCount are named ranges.

The formula works - however when nothing is entered on the spreadsheet (the
formula has nothing to count) it displays #DIV/01.

Is there anything I can add to the formula to stop this happening?

Any help would be great.

Cheers,

Phil

  #5   Report Post  
PW11111
 
Posts: n/a
Default


Not sure what you mean.

ISERROR only seems to return True or False, or the default vaule (0) that
you assign it.

"aristotle" wrote:

Really? IF(ISERROR()) should only supress errors. Can you give me an
example of the data values that should present a count other than 0?



"PW11111" wrote:


Hi

It does now return 0 instead of #DIV/01 - however it has stoped counting the
Main Contractor - Builderswork string. In otherwords its now always 0.!

Any ideas?

Thanks for the help.

Phil

"PW11111" wrote:


Hi

I have the following formula -

=COUNTIF(StatusCheck, "Snag Item")/COUNTIF(ElementCount,"Main Contractor -
Builderswork")

StatusCheck and ElementCount are named ranges.

The formula works - however when nothing is entered on the spreadsheet (the
formula has nothing to count) it displays #DIV/01.

Is there anything I can add to the formula to stop this happening?

Any help would be great.

Cheers,

Phil



  #6   Report Post  
aristotle
 
Posts: n/a
Default

The formula dictates that it should return 0 if the ISERROR element evaluates
to true, otherwise it if the ISERROR element evaluates to false, it should
continue with the original formula.
--
Please rate my response if you found it helpful. Thanks.


"PW11111" wrote:


Not sure what you mean.

ISERROR only seems to return True or False, or the default vaule (0) that
you assign it.

"aristotle" wrote:

Really? IF(ISERROR()) should only supress errors. Can you give me an
example of the data values that should present a count other than 0?



"PW11111" wrote:


Hi

It does now return 0 instead of #DIV/01 - however it has stoped counting the
Main Contractor - Builderswork string. In otherwords its now always 0.!

Any ideas?

Thanks for the help.

Phil

"PW11111" wrote:


Hi

I have the following formula -

=COUNTIF(StatusCheck, "Snag Item")/COUNTIF(ElementCount,"Main Contractor -
Builderswork")

StatusCheck and ElementCount are named ranges.

The formula works - however when nothing is entered on the spreadsheet (the
formula has nothing to count) it displays #DIV/01.

Is there anything I can add to the formula to stop this happening?

Any help would be great.

Cheers,

Phil

  #7   Report Post  
Max
 
Posts: n/a
Default

Perhaps 2 possible suspect areas:

a. The phrase: Main Contractor - Builderswork in the original post
had 2 spaces after the word "Contractor" before the dash "-" while the
suggested formula has one space. A mismatch, correctable by inserting the
extra space in the suggested formula.

b. Uncorrected line wraps / breaks in direct copy pasting from the formula
as posted could cause errors as well
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----


  #8   Report Post  
Jerry W. Lewis
 
Posts: n/a
Default

Assuming that there are no error value in your data ranges,
=IF(denominator,formula,"")
or
=IF(denominator,formula,0)
depending on what you want returned when there is no matching data.

IF(ISERROR(formula),formula,"") as previously suggested will work, but
unnecessarily calculates the numerator an extra time.

Jerry

PW11111 wrote:

Hi

I have the following formula -

=COUNTIF(StatusCheck, "Snag Item")/COUNTIF(ElementCount,"Main Contractor -
Builderswork")

StatusCheck and ElementCount are named ranges.

The formula works - however when nothing is entered on the spreadsheet (the
formula has nothing to count) it displays #DIV/01.

Is there anything I can add to the formula to stop this happening?

Any help would be great.

Cheers,

Phil


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
COUNTIF COMBINATION?? Heather Excel Worksheet Functions 1 April 26th 05 02:44 AM
Combining IF and COUNTIF based on two columns maxtrixx Excel Discussion (Misc queries) 5 March 31st 05 06:21 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM
Countif - Countif maswinney Excel Worksheet Functions 3 November 15th 04 11:06 PM
countif, again Liz G Excel Worksheet Functions 2 November 1st 04 11:20 PM


All times are GMT +1. The time now is 02:00 PM.

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

About Us

"It's about Microsoft Excel"