• Conditional Counting In a Report – Access 2007

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Conditional Counting In a Report – Access 2007

    • This topic has 2 replies, 2 voices, and was last updated 16 years ago.
    Author
    Topic
    #459844

    I have a report that displays an account name, then three fields that show if there is a problem in one or more of three areas. For example, if an account is missing a current financial statement, there would be an X in the balance sheet column. If the account type is incorrect, there would be an X in that column. In the underlying data, all three of the fields have either an N or a Y in that field.

    In my report footer, I want to count the number of problems for each of the three types of errors. In Excel, I would say =CountIf(CellRange,”N”). In Access, I want it to count field [BalSheet] if the value is N. Access does not seem to have a “countif” type function for reports, or I cannot find it.

    If I do a simply count, I get the total number of records which is not what I want.

    What am I missing?

    Thanks for your help.

    Nancy

    Viewing 0 reply threads
    Author
    Replies
    • #1160571

      You can use

      =Abs(Sum([BalSheet]=”N”))

      [BalSheet]=”N” is either True = -1 or False = 0. Sum adds the True values as -1’s. Abs converts negative to positive.

    Viewing 0 reply threads
    Reply To: Conditional Counting In a Report – Access 2007

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: