iif count -- Help!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to know if there is a way to sum a count if statement in a
report footer.

=IIf(Count([Acct Num])>=5,1,0)

I need to add the results of this equation. I've tried to
=sum(IIf(Count([Acct Num])>=5,1,0)) But this doesn't work. Any suggestions.
 
luscioussarita said:
I would like to know if there is a way to sum a count if statement in a
report footer.

=IIf(Count([Acct Num])>=5,1,0)

I need to add the results of this equation. I've tried to
=sum(IIf(Count([Acct Num])>=5,1,0)) But this doesn't work. Any suggestions.


Here's an expression that should do what you want:
=Sum(IIF([Acct Num])>=5,1,0))

But, I don't understand what you mean by "add the results of
this equation"
 
If you are grouping on each person(?), then add a text box
named txtAccts5 in the group header or footer with the
expression:
=IIf(Count([Acct Num]) >= 5, 1, 0))
Then set the text box's RunningSum property to Over All.

The total number of people with 5 or more accounts can then
be displayed in the report footer by using the expression
=txtAccts5

If that's not what you're looking for, then I guess I still
don't understand. Maybe it would help me grasp the problem
if you'll answer these questions.

What data is the report operating on?
What do you mean by "anyone"?
Does the report use Sorting and Grouping? If it does, what
field are you grouping on?
--
Marsh
MVP [MS Access]


I am sorry if I wasn't clear. This equation will give me a result of ones.
Those ones represent anyone that has >=5 accounts. I want to sum up those
ones in the page footer, if possible. I've tried this as well with a result
of a zero =Sum(IIF([Acct Num])>=5,1,0))

luscioussarita said:
I would like to know if there is a way to sum a count if statement in a
report footer.

=IIf(Count([Acct Num])>=5,1,0)

I need to add the results of this equation. I've tried to
=sum(IIf(Count([Acct Num])>=5,1,0)) But this doesn't work.
 
Marshall you are my saving angel. Yes, this is exactly what I needed. I had
to play with it a little bit but it worked perfectly.

Thank you.

luscioussarita

Marshall Barton said:
If you are grouping on each person(?), then add a text box
named txtAccts5 in the group header or footer with the
expression:
=IIf(Count([Acct Num]) >= 5, 1, 0))
Then set the text box's RunningSum property to Over All.

The total number of people with 5 or more accounts can then
be displayed in the report footer by using the expression
=txtAccts5

If that's not what you're looking for, then I guess I still
don't understand. Maybe it would help me grasp the problem
if you'll answer these questions.

What data is the report operating on?
What do you mean by "anyone"?
Does the report use Sorting and Grouping? If it does, what
field are you grouping on?
--
Marsh
MVP [MS Access]


I am sorry if I wasn't clear. This equation will give me a result of ones.
Those ones represent anyone that has >=5 accounts. I want to sum up those
ones in the page footer, if possible. I've tried this as well with a result
of a zero =Sum(IIF([Acct Num])>=5,1,0))

luscioussarita wrote:
I would like to know if there is a way to sum a count if statement in a
report footer.

=IIf(Count([Acct Num])>=5,1,0)

I need to add the results of this equation. I've tried to
=sum(IIf(Count([Acct Num])>=5,1,0)) But this doesn't work.
 
Back
Top