Jump to content
john9210

Parsing a compound name

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Who Viewed the Topic

    2 members have viewed this topic:
    NLMR  robyt 
×
×
  • Create New...

Important Information

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