john9210 Posted November 15, 2018 Posted November 15, 2018 I’m using the following formula to count the number of people in a compound name. If[WordCount(name)>2,2,1]. It gives the following results: Name Result Smith, Jane 1 Smith, Jane and Joe 2 Smith, Jane Agnes 2 The last result is incorrect. It should be 1 since Jane Agnes is a first name. What would be a correct formula to use?
comment Posted November 15, 2018 Posted November 15, 2018 I am afraid these examples are not sufficient to determine what rules your data follows. I am guessing that "Smith-Jones, Adam" would also fail your test. The question is: what is unique to an entry of two (or more?) people? Will they always have the same last name? Will there always be an " and " separating their first names?
john9210 Posted November 15, 2018 Author Posted November 15, 2018 What I'm trying to do is determine the number of people a name represents. In a name, both persons always have the same last name. There is always be an "and" separating the last and first names. Generally, names are entered as" Jones, Mary" for one person, "Jones, Mary and John" for two persons. The problem arises when the first name is made up of two parts, a relatively rare occasion, but it does happen.
Lee Smith Posted November 15, 2018 Posted November 15, 2018 Hi John, When asking for help on parsing text, it is always best to provide actual examples of the data. There are so many variables that can effect the results. In fact, a copy of the file is usually helpful. Lee
comment Posted November 15, 2018 Posted November 15, 2018 If there's always an " and " separating the names, then do a PatternCount() for it. Make sure to include the surrounding spaces to avoid false positives with names like Brandon.
Recommended Posts
This topic is 2218 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