Given Data GVKEY fyear EXECID TITLEANN AGE 002538 2007 02158 president & CEO 56 002538 2008 02158 president & CEO 57 002538 2009 02158 58 002538 2010 02158 59 002538 2011 42441 57 002538 2012 42441 58 002538 2013 42441 59 002538 2014 42439 Chief Financial Officer and Executive Vice President 63 002538 2015 30776 50 002538 2016 30776 51 002554 1993 00222 chmn. & CEO 002554 1994 00222 chmn. & CEO 59 002554 1995 00222 chmn. & CEO 60 002554 1996 00222 chmn. & CEO 002554 1997 00222 chmn. & CEO 62 002554 1998 00222 chmn. & CEO 002555 1992 05687 002555 1993 05687 chmn. & CEO 62 002555 1994 05687 chmn. & CEO 63 002555 1995 05687 chmn. & CEO 64 002555 1996 05687 chmn. & CEO 65 002555 1997 05687 chmn. & CEO 66 002555 1998 05687 chmn. & CEO 67 002555 1999 05687 chmn. & CEO 68 002555 2000 05687 chairman & CEO 69 002555 2001 23867 chairman & CEO 55 002555 2002 23867 chairman, president & CEO 56 002555 2003 23867 chairman, president & CEO 002555 2005 28398 chairman 37 002555 2006 30037 former CEO 002555 2007 30038 CEO 47 002555 2008 30038 president & CEO 48 002555 2009 30038 49 002555 2010 30038 50 002555 2011 30038 51 002562 1992 00263 chmn., pres. & CEO 002562 1993 00263 chmn., pres. & CEO 54 002562 1994 00263 chmn., pres. & CEO 55 I want the following results: So, I want to fill the Titleann and age column. Some of the missing observations will be filled based on previously given information(yellow colored one) and some of the observations will be filled based on the later information(green colored one). And It is not possible to fill some of the missing values as there is no previous and after values are given for those. Missing values will be filled based on "EXECID" Also, GVKEY and FYEAR are important because the same executive may serve in different companies in different year. Can anyone please help me by giving the code?
... View more