David Jondreau Posted May 30, 2008 Posted May 30, 2008 I just discovered that PatternCount() doesn't check for overlapping strings. For instance the calculation: Let( list = "1¶2¶3¶4¶4¶3¶3"; PatternCount(¶ & list & ¶; "¶4¶") ) returns 1. Threw me for a loop when I was trying to get a count of a specific value in a list. So, Let( list = "2¶2¶4¶4¶2¶14¶2¶41"; PatternCount(list; 4) ) returns 4, but I want the result (for both examples) to be 2. As I type this I realize FilterValues() and ValueCount() will do what I want. But the PatternCount() thing is still weird isn't it?
comment Posted May 30, 2008 Posted May 30, 2008 I don't find it weird. It's documented in the help, and it matches the Position() function which isn't inclusive either: Position ( "Mississippi" ; "issi" ; 1 ; 2 ) returns 0. It would be easy to write an inclusive PatternCount() custom function, if needed.
Recommended Posts
This topic is 6080 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