Share via

CountIf in Access

Anonymous
2011-09-05T02:14:55+00:00

I created a report in Access with a field "Amount Paid."  At the end of the report, I would like to count the number of registrants paid if the amount in the column is greater than 0.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2011-09-05T11:39:03+00:00

And if the question is about to count those where the amount is > 0 and that you can't use that condition, amount > 0, in the where clause for some reason, then you can use:

COUNT( iif(amount > 0, 1, null ) )

or

SUM( iif(amount > 0, 1, 0) )

Was this answer helpful?

50+ people found this answer helpful.
0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2011-09-05T13:09:01+00:00

    The answer also helped me with a formula for counting in another field.  The difference is the second field I was counting was = rather than .  It worked!  Thank you so much.

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2011-09-05T13:03:47+00:00

    You are correct that my question was unclear.  I used the following to get the result needed:

    =Count(IIf([AmountPaid]>0,1,Null))

    Thank you so much and I'm sorry for the confusion.

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments
  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. Anonymous
    2011-09-05T04:40:05+00:00

    CountIf is an Excel function that doesn't cross over into Access. I'd suggest using the IIF() function:

    IIF([Amount Paid] > 0, Count(*), 0)

    will count the total number of records in the report if Amount Paid is greater than 0, and retrun 0 otherwise.

    Your question isn't altogether clear so I may have misinterpreted.

    Was this answer helpful?

    0 comments No comments