Count if function in query help (1 Viewer)

Angel69

Registered User.
Local time
Yesterday, 20:11
Joined
Jun 11, 2013
Messages
86
I have three set limits:

$10 - $100
$101 - $500
$501 - $10,000

I want to count the number of transactions that are equal to or greater than $10 AND equal to $100. I want to do the same for the other sets. I started the below formula but got an error. Any ideas?

Expr1: Count(IIf([amount],">=10")+Count(IIf([amount],"=100")))

Thanks!
 

boblarson

Smeghead
Local time
Yesterday, 17:11
Joined
Jan 12, 2001
Messages
32,059
MyCounts:Sum(IIf([amount] >=10, 1, 0)) + Sum(IIf([amount] = 100, 1, 0))

You don't use quotes for the >=10 or = 100.

And won't the count of >=10 AND adding count of =100 double count?
 

Angel69

Registered User.
Local time
Yesterday, 20:11
Joined
Jun 11, 2013
Messages
86
I have a total of 12 items greater than 10 so it's adding them all up. I need to somehow specify to count only items between 10-100, 101-500, and 501-10,000.
 

Angel69

Registered User.
Local time
Yesterday, 20:11
Joined
Jun 11, 2013
Messages
86
Got it!

I did this:

$10 - $100: Sum(IIf([amount] Between 10 And 100,1,0))
 

Users who are viewing this thread

Top Bottom