Returns the number of occurrences of searchString in text.


PatternCount ( text ; searchString )


text - any text expression or text field

searchString - any text expression or text field representing the text you want to find

Data type returned 


Originated in version 

6.0 or earlier


This function is not case sensitive. PatternCount begins at the start of text and counts each non-overlapping occurrence of searchString.

Example 1 

PatternCount ( "Mississippi" ; "is" ) returns 2.

Example 2 

PatternCount ( "Mississippi" ; "issi" ) returns 1. A second possible occurrence starting at character 5 is not counted because it overlaps the first occurrence at characters 2 through 5.

Example 3 

PatternCount ( Attending ; "Guest" ) returns 1 if the Guest checkbox is one of the items selected in the Attending field.

Example 4 

PatternCount ( Get ( AccountPrivilegeSetName ) ; "Read-Only Access" ) returns 0 if the current account access has the Full Access privilege set.