Dear Statalists,

I have a dataset including six variables: ID PersonName ExcelPersonID CompanyName Biographies NewCompanyName1.

Variable NewCompanyName1 contains information about the company that the person in PersonName is currently working for.

Variable Biographies summarize information about the person's work experience (in PersonName) including time spent with the company in NewCompanyName1 and several others.

I would like to create a new variable which is the working period of the person (in PersonName) at the company contained in NewCompanyName1.

For example:

PersonName: Stock, Kevin (Prior)

NewCompanyName1: Michael Hill International Limited

Biographies: Mr. Kevin Stock, B Arts has been Retail General Manager of Australia at Michael Hill International Limited since 2003. Mr. Stock is responsible for the overall performance of the Australasian retail division. He moved from the United States in 1990. He started with Michael Hill in 1995 as a store management trainee in the first Melbourne store-Eastland. After managing stores for 5 years, he became a Regional Manager for 2 years in Victoria.

The new variable will be: "since 2003"

I have searched online but I could not find out any example like my task.

Any assistance is greatly appreciated.

Kh Trinh