Combining DCOUNT with OR

D

dmaslen

That will work great for a small dataset, but the MasterDatabase that
am referring to is tens of thousands of rows, and I have 15 responses
The MasterDatabase is also a dataset that is being pulled from a
Oracle database using Microsoft Query, so when I refresh the data,
want this function to update itself automatically. I can't be copyin
and pasting functions every time I do a refresh. I have defined thi
dataset as MasterDatabase, and believe it is possible to accomplis
what I am trying to do with the DCOUNT function.

Here is a sample dataset again, defined as MasterDatabase, in A1:E7

Type Response 1 Response 2 Response 3 Response 4
0 1 2 5 6
1 5 4 1 7
2 1 5 6 8
2 8 6 3 5
1 9 5 4 3
0 9 8 7 6

Now if I was to put in the function =DCOUNT(MasterDatabase,A1,G6:G7)

And in the criteria at G6:G7 I had:

Response 1
<=4

This function would count all the rows where Response 1 was <=4. That'
great.

Now, how do I set up the criteria so it will act like an O
statement??

If I do:

Response 1 Response 2
<=4 <=4

it acts like an AND statement and will find any row where both respons
1 and 2 are <=4. That's not what I want.

How do you set up criteria so that it represents an "OR" statement?

Dav
 
P

Peo Sjoblom

Why not use

=DCOUNT(MasterDatabase,A1,G6:G7)+DCOUNT(MasterDatabase,A1,H6:H7)

where you would add

Response 2
<=4

in H6:H7


Regards,

Peo Sjoblom
 
Top