Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Formula in DCounta Criteria

I'm trying to create multiple queries for users using dropdown lists.

I use the formula =IF(ISBLANK(J4),"","="&J4) in the criteria range.

However, Dcounta does not count the record if the field in the record is
blank.

If I do the exact same query except have nothing in the criteria cell, it
counts all records. I think the problem is that DCounta does not an empty
string "" the same as a true blank cell.

Anybody have any suggestions on how to work around this?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Formula in DCounta Criteria

Why not just use

=COUNTIF(C:C,J4)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"dcwood57" wrote in message
...
I'm trying to create multiple queries for users using dropdown lists.

I use the formula =IF(ISBLANK(J4),"","="&J4) in the criteria range.

However, Dcounta does not count the record if the field in the record is
blank.

If I do the exact same query except have nothing in the criteria cell, it
counts all records. I think the problem is that DCounta does not an empty
string "" the same as a true blank cell.

Anybody have any suggestions on how to work around this?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Formula in DCounta Criteria

I am trying to have the ability for the users to choose to have multiple
criteria. For example, dropdown for Salesperson, Date, Process Step . . .

I'm not sure that COUNTIF function can use multiple criteria?

"Bob Phillips" wrote:

Why not just use

=COUNTIF(C:C,J4)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"dcwood57" wrote in message
...
I'm trying to create multiple queries for users using dropdown lists.

I use the formula =IF(ISBLANK(J4),"","="&J4) in the criteria range.

However, Dcounta does not count the record if the field in the record is
blank.

If I do the exact same query except have nothing in the criteria cell, it
counts all records. I think the problem is that DCounta does not an empty
string "" the same as a true blank cell.

Anybody have any suggestions on how to work around this?

Thanks.




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Formula in DCounta Criteria

No but SUMPRODUCT can

=SUMPRODUCT(--(rng1=value1),--(rng2="value2"))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"dcwood57" wrote in message
...
I am trying to have the ability for the users to choose to have multiple
criteria. For example, dropdown for Salesperson, Date, Process Step . . .

I'm not sure that COUNTIF function can use multiple criteria?

"Bob Phillips" wrote:

Why not just use

=COUNTIF(C:C,J4)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"dcwood57" wrote in message
...
I'm trying to create multiple queries for users using dropdown lists.

I use the formula =IF(ISBLANK(J4),"","="&J4) in the criteria range.

However, Dcounta does not count the record if the field in the record
is
blank.

If I do the exact same query except have nothing in the criteria cell,
it
counts all records. I think the problem is that DCounta does not an
empty
string "" the same as a true blank cell.

Anybody have any suggestions on how to work around this?

Thanks.






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Formula in DCounta Criteria

What's the problem, assume that the database was A4:A20 and there were 5
empty cells
and J4 is empty, what do you expect the formula to return? Also are the
blanks in the database empty cells or are they blanks from formulas like "",
if the latter DCOUNTA will count all cells
if not it will ignore it. You can use a formula like this instead

=SUMPRODUCT(--(A5:A20=J4))

will count A5:A20 using what's in J4


--


Regards,


Peo Sjoblom




"dcwood57" wrote in message
...
I'm trying to create multiple queries for users using dropdown lists.

I use the formula =IF(ISBLANK(J4),"","="&J4) in the criteria range.

However, Dcounta does not count the record if the field in the record is
blank.

If I do the exact same query except have nothing in the criteria cell, it
counts all records. I think the problem is that DCounta does not an empty
string "" the same as a true blank cell.

Anybody have any suggestions on how to work around this?

Thanks.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Formula in DCounta Criteria

The advantage of using DCountA() is that you are able to use multiple
criteria. For example, I want to count all the instances in the database
where it is between dates A & B AND Process Step 1 was accomplished. If I
leave the "SalesRep" field blank, I want it to count ALL rows where Process
Step 1 was accomplished, regardless of whether or not there was a salesrep
assigned.

Is there a place where we can post examples? It is very simple to show the
problem, simpler than to explain it.

"Peo Sjoblom" wrote:

What's the problem, assume that the database was A4:A20 and there were 5
empty cells
and J4 is empty, what do you expect the formula to return? Also are the
blanks in the database empty cells or are they blanks from formulas like "",
if the latter DCOUNTA will count all cells
if not it will ignore it. You can use a formula like this instead

=SUMPRODUCT(--(A5:A20=J4))

will count A5:A20 using what's in J4


--


Regards,


Peo Sjoblom




"dcwood57" wrote in message
...
I'm trying to create multiple queries for users using dropdown lists.

I use the formula =IF(ISBLANK(J4),"","="&J4) in the criteria range.

However, Dcounta does not count the record if the field in the record is
blank.

If I do the exact same query except have nothing in the criteria cell, it
counts all records. I think the problem is that DCounta does not an empty
string "" the same as a true blank cell.

Anybody have any suggestions on how to work around this?

Thanks.




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Formula in DCounta Criteria

You can use multiple criteria as well with SUMPRODUCT, it's much more
versatile than the archaic D functions

=SUMPRODUCT(--(A1:A50=J4),--(B1:B50=DATE(2007,1,15)),--(B1:B50<=DATE(2007,1,31)))

--


Regards,


Peo Sjoblom



"dcwood57" wrote in message
...
The advantage of using DCountA() is that you are able to use multiple
criteria. For example, I want to count all the instances in the database
where it is between dates A & B AND Process Step 1 was accomplished. If I
leave the "SalesRep" field blank, I want it to count ALL rows where
Process
Step 1 was accomplished, regardless of whether or not there was a salesrep
assigned.

Is there a place where we can post examples? It is very simple to show
the
problem, simpler than to explain it.

"Peo Sjoblom" wrote:

What's the problem, assume that the database was A4:A20 and there were 5
empty cells
and J4 is empty, what do you expect the formula to return? Also are the
blanks in the database empty cells or are they blanks from formulas like
"",
if the latter DCOUNTA will count all cells
if not it will ignore it. You can use a formula like this instead

=SUMPRODUCT(--(A5:A20=J4))

will count A5:A20 using what's in J4


--


Regards,


Peo Sjoblom




"dcwood57" wrote in message
...
I'm trying to create multiple queries for users using dropdown lists.

I use the formula =IF(ISBLANK(J4),"","="&J4) in the criteria range.

However, Dcounta does not count the record if the field in the record
is
blank.

If I do the exact same query except have nothing in the criteria cell,
it
counts all records. I think the problem is that DCounta does not an
empty
string "" the same as a true blank cell.

Anybody have any suggestions on how to work around this?

Thanks.






  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Formula in DCounta Criteria

I can see that I am definitely going to have to investigate SUMPRODUCT more.
Thanks for the direction, this may work.

"Peo Sjoblom" wrote:

You can use multiple criteria as well with SUMPRODUCT, it's much more
versatile than the archaic D functions

=SUMPRODUCT(--(A1:A50=J4),--(B1:B50=DATE(2007,1,15)),--(B1:B50<=DATE(2007,1,31)))

--


Regards,


Peo Sjoblom



"dcwood57" wrote in message
...
The advantage of using DCountA() is that you are able to use multiple
criteria. For example, I want to count all the instances in the database
where it is between dates A & B AND Process Step 1 was accomplished. If I
leave the "SalesRep" field blank, I want it to count ALL rows where
Process
Step 1 was accomplished, regardless of whether or not there was a salesrep
assigned.

Is there a place where we can post examples? It is very simple to show
the
problem, simpler than to explain it.

"Peo Sjoblom" wrote:

What's the problem, assume that the database was A4:A20 and there were 5
empty cells
and J4 is empty, what do you expect the formula to return? Also are the
blanks in the database empty cells or are they blanks from formulas like
"",
if the latter DCOUNTA will count all cells
if not it will ignore it. You can use a formula like this instead

=SUMPRODUCT(--(A5:A20=J4))

will count A5:A20 using what's in J4


--


Regards,


Peo Sjoblom




"dcwood57" wrote in message
...
I'm trying to create multiple queries for users using dropdown lists.

I use the formula =IF(ISBLANK(J4),"","="&J4) in the criteria range.

However, Dcounta does not count the record if the field in the record
is
blank.

If I do the exact same query except have nothing in the criteria cell,
it
counts all records. I think the problem is that DCounta does not an
empty
string "" the same as a true blank cell.

Anybody have any suggestions on how to work around this?

Thanks.






  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Formula in DCounta Criteria

I forgot to say that the formula I posted will count what's in J4 in A1:A50
where the dates in B1:B50 are between Jan 15 07 and Jan 31 07


--


Regards,


Peo Sjoblom


"dcwood57" wrote in message
...
I can see that I am definitely going to have to investigate SUMPRODUCT
more.
Thanks for the direction, this may work.

"Peo Sjoblom" wrote:

You can use multiple criteria as well with SUMPRODUCT, it's much more
versatile than the archaic D functions

=SUMPRODUCT(--(A1:A50=J4),--(B1:B50=DATE(2007,1,15)),--(B1:B50<=DATE(2007,1,31)))

--


Regards,


Peo Sjoblom



"dcwood57" wrote in message
...
The advantage of using DCountA() is that you are able to use multiple
criteria. For example, I want to count all the instances in the
database
where it is between dates A & B AND Process Step 1 was accomplished.
If I
leave the "SalesRep" field blank, I want it to count ALL rows where
Process
Step 1 was accomplished, regardless of whether or not there was a
salesrep
assigned.

Is there a place where we can post examples? It is very simple to show
the
problem, simpler than to explain it.

"Peo Sjoblom" wrote:

What's the problem, assume that the database was A4:A20 and there were
5
empty cells
and J4 is empty, what do you expect the formula to return? Also are
the
blanks in the database empty cells or are they blanks from formulas
like
"",
if the latter DCOUNTA will count all cells
if not it will ignore it. You can use a formula like this instead

=SUMPRODUCT(--(A5:A20=J4))

will count A5:A20 using what's in J4


--


Regards,


Peo Sjoblom




"dcwood57" wrote in message
...
I'm trying to create multiple queries for users using dropdown
lists.

I use the formula =IF(ISBLANK(J4),"","="&J4) in the criteria range.

However, Dcounta does not count the record if the field in the
record
is
blank.

If I do the exact same query except have nothing in the criteria
cell,
it
counts all records. I think the problem is that DCounta does not an
empty
string "" the same as a true blank cell.

Anybody have any suggestions on how to work around this?

Thanks.








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
DCOUNTA WITH MULTIPLE FIELD CRITERIA galsaba Excel Worksheet Functions 3 October 9th 07 03:51 PM
DCOUNTA Complex Criteria Question Elliot Colbert Excel Worksheet Functions 5 June 19th 06 10:57 PM
Criteria for DCOUNTA for date values wacNTN Excel Discussion (Misc queries) 1 April 25th 06 07:52 PM
Specify DCOUNTA Criteria in the Formula JLBennett Excel Discussion (Misc queries) 2 August 24th 05 08:20 AM
Sum Multiple Criteria or DcountA rjenkins Excel Worksheet Functions 3 July 16th 05 12:21 AM


All times are GMT +1. The time now is 03:15 AM.

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

About Us

"It's about Microsoft Excel"