Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I want to create a function that works like "Countif" in Excel. For example, to count only the text value "7" in a series of cells in Excel I use:

=COUNTIF(A2:Z2,7)

which ignores any other text value and counts the occurrences of the value "7". In FMP how do I get the same result?

Filemaker doesn't have a built-in CountIf function. You could write a custom function using the Advanced version, but Filemaker's "native" way to deal with aggregating data is to use relationships or produce a sub-summarized report.

I want to create a function that works like "Countif" in Excel. For example, to count only the text value "7" in a series of cells in Excel I use:

=COUNTIF(A2:Z2,7)

which ignores any other text value and counts the occurrences of the value "7". In FMP how do I get the same result?

ValueCount( FilterValues( List( relation::Field); "7"))

  • Author

Thank you!

  • Author

I have now used it several times. Awesome!

Here is the syntax where is the field:

ValueCount(FilterValues((Grade);"7"))

ValueCount( FilterValues( List( relation::Field); "7"))

That's pretty nifty!

It is an elegant solution for the given example - but it's not a true CountIf(). It only works when the test is for equality (CountSimilar?).

  • 10 months later...

ValueCount( FilterValues( List( relation::Field); "7")) works great for static values (eg. words and strings).

I want to count values greather than "7". I tried something like this

ValueCount( FilterValues( List( relation::Field); "relation::Field > 7")) However, it returns me "0"

I believe this was already answered in the previous posts in this thread.

  • 8 years later...
  • Newbies

Thank you ALL contributors to this feed! This problem has quite simply been doing my head in for a few hours. 

I used the following:

ValueCount( FilterValues( List( RELATED TABLE I WANTED TO SEARCH::THE FIELD I WANTED TO COUNT THE NUMBER OF REPETITIONS ); THE MATCHED FIELD))

Example below:

ValueCount( FilterValues( List( Car Inventory::Car Type); "Landrover"))

Result:

The number of records that match the car type 'Landrover' within the table inventory

Edited by bmftn

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.