Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages

Shopping Cart
Shopping Cart


Free Newsletter


Privacy Policy

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.


 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

CountWordOccurrences ( text ; searchWord )

Rate this function:  

  Average rating: 4.9  (33 votes)
  Discuss this Custom Function

Michael Horak, *COMMENT Visual Realisation

Returns the number of occurrences of searchWord as word in text.

Sample Input:
CountWordOccurrences ( "Ground control to Major Tom, ground control to Major Tom: can you hear me, Major Tom?" ; "tom" )

CountWordOccurrences ( "Tom stomped on an atom." ; "tom" )

CountWordOccurrences ( "Tom's tomcat stomped on an atom." ; "tom" )
Sample Output:



 Then copy & paste into FileMaker Advanced's Edit Custom Function window.


Returns the number of occurrences searchWord appears as a word in text. The function is NOT case-sensitive.

Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it


5 most recent comments | Show all 6 comments

It may be simpler, but it's not doing the same thing at all: check your results against mine in the examples above.

comment, VR
February 08, 2012 12:41am

I see what you mean, sorry about this.

Henk Brendel, Arnhem, NL
February 08, 2012 1:28am

This is exaclty what I need, but FileMaker 11 gives me an error. "This function cannot be found."
I believe it is refering to "Let ( countWords = WordCount ( text )".

Can you help me understand, please.

Thanks in advance.

Danton Wetzel, Saint George, UT
September 10, 2013 9:03am

Like this function much but problems with it.


You ever get this custom function to work properly?


When i use it in a text field that is lengthy i get a spinning ball and have to wait long time!!

jLT StructuresFromSilence, Kendv,IN USA
April 08, 2015 3:45pm


This function goes over your text word-by-word. That takes some time. It was not meant to be applied to large texts, and in any case the maximum amount of words it can process is limited to 10,000 (Filemaker's limit of iterations for custom functions that are not tail-recursive).

You may consider implementing the same algorithm in a looping script, and run the script on demand only, storing the result in a field.

comment, VR
April 08, 2015 6:33pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 3 + 8 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. JSONArrayLength ( JSONArrayStr )
  (Fri, May 25, 7:46am)
2. interpolation (y1; y2; y3; x1; x2; x3; x1y1; x2y1; x1y2; x2y2; rnd)
  (Sat, May 19, 3:55am)
3. @JSONFormatElements ( json )
  (Tue, May 15, 3:31am)
4. WindowNamesAll ( dbNames ; excludeCurrentWindow )
  (Sat, May 12, 11:34am)
5. RandomChoiceFromList ( values ; required )
  (Wed, May 02, 6:35am)
6. @JSONFormatElements ( json )
  (Fri, Apr 27, 7:31am)
7. MBS-OCR ( language ; Image )
  (Mon, Apr 23, 1:48pm)
8. MBS_Image_Rotate ( Picture ; rotation )
  (Mon, Apr 23, 1:27pm)

RSS Feed of Custom Functions