tforbes Posted October 19, 2008 Share Posted October 19, 2008 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? Link to comment Share on other sites More sharing options...
comment Posted October 19, 2008 Share Posted October 19, 2008 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. Link to comment Share on other sites More sharing options...
bruceR Posted October 20, 2008 Share Posted October 20, 2008 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")) Link to comment Share on other sites More sharing options...
tforbes Posted October 26, 2008 Author Share Posted October 26, 2008 Thank you! Link to comment Share on other sites More sharing options...
tforbes Posted November 2, 2008 Author Share Posted November 2, 2008 I have now used it several times. Awesome! Here is the syntax where is the field: ValueCount(FilterValues((Grade);"7")) Link to comment Share on other sites More sharing options...
David Jondreau Posted November 2, 2008 Share Posted November 2, 2008 ValueCount( FilterValues( List( relation::Field); "7")) That's pretty nifty! Link to comment Share on other sites More sharing options...
comment Posted November 2, 2008 Share Posted November 2, 2008 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?). Link to comment Share on other sites More sharing options...
Coriolan_66 Posted September 23, 2009 Share Posted September 23, 2009 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" Link to comment Share on other sites More sharing options...
comment Posted September 23, 2009 Share Posted September 23, 2009 I believe this was already answered in the previous posts in this thread. Link to comment Share on other sites More sharing options...
Newbies bmftn Posted July 24, 2018 Newbies Share Posted July 24, 2018 (edited) 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 July 24, 2018 by bmftn Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 2074 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now