Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Countif worksheet function frustrations

I've got a worksheet that uses the following countif function:

{=COUNT(IF((bay.cost.1=B97)*(dept.1="DOTAG"),bay.c ost.1))}

and it works, B97 is a currency value.

In another worksheet I have

{=COUNT(IF((mhc.lease.no=F17)*(mhc.dept="DOTAG"),m hc.lease.no))}

Where F17 is a text field, but the second one doesn't work.

However, this works instead

{=SUM(IF((mhc.lease.no=F17)*(mhc.dept="DCS"),1,0)) }

Is there any reason why the first countif works but not the second?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 510
Default Countif worksheet function frustrations

Hi,

Have you tried :
{=COUNT(IF(--(mhc.lease.no=F17)*(mhc.dept="DOTAG"),mhc.lease.no ))}


HTH
Carim

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Countif worksheet function frustrations

Is there any reason why the first countif works but not the second?
{=COUNT(IF((bay.cost.1=B97)*(dept.1="DOTAG"),bay. cost.1))}
and it works, B97 is a currency value.


It works because bay.cost.1 are numeric values and that's what COUNT does.
It counts numbers.

{=COUNT(IF((mhc.lease.no=F17)*(mhc.dept="DOTAG"), mhc.lease.no))}


Your other formula would like this:

{=COUNT(IF((mhc.lease.no=F17)*(mhc.dept="DOTAG"),1 ))}

However, there's a better way to do this using non-array formulas:

=SUMPRODUCT(--(bay.cost.1=B97),--(dept.1="DOTAG"))

=SUMPRODUCT(--(mhc.lease.no=F17),--(mhc.dept="DOTAG"))

Biff

"Santa-D" wrote in message
ups.com...
I've got a worksheet that uses the following countif function:

{=COUNT(IF((bay.cost.1=B97)*(dept.1="DOTAG"),bay.c ost.1))}

and it works, B97 is a currency value.

In another worksheet I have

{=COUNT(IF((mhc.lease.no=F17)*(mhc.dept="DOTAG"),m hc.lease.no))}

Where F17 is a text field, but the second one doesn't work.

However, this works instead

{=SUM(IF((mhc.lease.no=F17)*(mhc.dept="DCS"),1,0)) }

Is there any reason why the first countif works but not the second?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Countif worksheet function frustrations

Ooops! Missing word: (how do we miss entire words?)

Your other formula would like this:
{=COUNT(IF((mhc.lease.no=F17)*(mhc.dept="DOTAG"), 1))}


Should be:

Your other formula would work like this:

Biff

"Biff" wrote in message
...
Is there any reason why the first countif works but not the second?
{=COUNT(IF((bay.cost.1=B97)*(dept.1="DOTAG"),bay .cost.1))}
and it works, B97 is a currency value.


It works because bay.cost.1 are numeric values and that's what COUNT does.
It counts numbers.

{=COUNT(IF((mhc.lease.no=F17)*(mhc.dept="DOTAG") ,mhc.lease.no))}


Your other formula would like this:

{=COUNT(IF((mhc.lease.no=F17)*(mhc.dept="DOTAG"),1 ))}

However, there's a better way to do this using non-array formulas:

=SUMPRODUCT(--(bay.cost.1=B97),--(dept.1="DOTAG"))

=SUMPRODUCT(--(mhc.lease.no=F17),--(mhc.dept="DOTAG"))

Biff

"Santa-D" wrote in message
ups.com...
I've got a worksheet that uses the following countif function:

{=COUNT(IF((bay.cost.1=B97)*(dept.1="DOTAG"),bay.c ost.1))}

and it works, B97 is a currency value.

In another worksheet I have

{=COUNT(IF((mhc.lease.no=F17)*(mhc.dept="DOTAG"),m hc.lease.no))}

Where F17 is a text field, but the second one doesn't work.

However, this works instead

{=SUM(IF((mhc.lease.no=F17)*(mhc.dept="DCS"),1,0)) }

Is there any reason why the first countif works but not the second?





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Countif worksheet function frustrations

{=COUNT(IF((mhc.lease.no=F17)*(mhc.dept="DOTAG"),m hc.lease.no))}

For this model, you have to use COUNTA instead of COUNT



"Santa-D" wrote:

I've got a worksheet that uses the following countif function:

{=COUNT(IF((bay.cost.1=B97)*(dept.1="DOTAG"),bay.c ost.1))}

and it works, B97 is a currency value.

In another worksheet I have

{=COUNT(IF((mhc.lease.no=F17)*(mhc.dept="DOTAG"),m hc.lease.no))}

Where F17 is a text field, but the second one doesn't work.

However, this works instead

{=SUM(IF((mhc.lease.no=F17)*(mhc.dept="DCS"),1,0)) }

Is there any reason why the first countif works but not the second?




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 733
Default Countif worksheet function frustrations

Biff wrote...
....
Your other formula would like this:

{=COUNT(IF((mhc.lease.no=F17)*(mhc.dept="DOTAG"), 1))}

....

Or it could look like

=COUNT(1/((mhc.lease.no=F17)*(mhc.dept="DOTAG")))

but agree that SUMPRODUCT would be better.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Countif worksheet function frustrations

Hi everyone, thank you for your help & support. It's been fantastic.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default Countif worksheet function frustrations

=SUMPRODUCT(--(mhc.lease.no=F17),--(mhc.dept="DOTAG"))

What does the -- represent?
I've been looking in a few ebooks that I have and i'm unable to locate
any reference to the "--"

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default Countif worksheet function frustrations

It coerces a True/False result into a 1/0.

Best place to read up on this is Bob Phillips site. He gets into this
just over half way through this article:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

HTH,

Ken Puls, CMA - Microsoft MVP (Excel)
www.excelguru.ca

Santa-D wrote:
=SUMPRODUCT(--(mhc.lease.no=F17),--(mhc.dept="DOTAG"))

What does the -- represent?
I've been looking in a few ebooks that I have and i'm unable to locate
any reference to the "--"

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
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
CountIf Function Question Josh in Indy Excel Discussion (Misc queries) 4 April 6th 06 08:28 PM
CountIF Function On Linked Spreadsheet Josh in Indy Excel Discussion (Misc queries) 0 April 5th 06 05:09 PM
CountIf Function Help Needed Mark Excel Worksheet Functions 4 January 30th 06 03:37 AM
changing type style and colour within a worksheet function gvm Excel Worksheet Functions 0 July 25th 05 03:03 AM


All times are GMT +1. The time now is 03:54 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"