Counting cells containing specific text

GregP

Registered User.
Local time
Tomorrow, 04:48
Joined
Sep 16, 2002
Messages
66
How do you count how many times a specific string of text occurs in a given field within a report? For example, if a database recorded the results of a voting session, and I wanted to count how many people had recorded "Bob" in the "Choice" field, how what format would I use? Whenever I try functions like =count([Choice]="Bob"), or even =count([Choice]=9d399pyjhgqo7y), all I get is the total number of fields for which "Choice" exists, i.e. the total number of votes, irrespective of the content of the "Choice" field, as though I had simply entered =count([Choice]). How can the count function be given specific parameters to count?
 
Found the answer

Finally found someone else's post regarding a similar thing. Formula is:

=Sum(IIf([Choice]="Bob",1,0))

This returns a 1 for everytime the choice is Bob, and a 0 for every time it's NOT Bob. Still find it strange that =count doesn't include an option for this, but this one works, that's the main thing.
 

Users who are viewing this thread

Back
Top Bottom