Thank you for all your kind supports. May I suggest another problem? I have data A with loss of data and data B with full trading days, after merging I get data C. For days of loss data and only in the boundaries of trading days of stock S001, S002, S00..in data A, the return in those days will equal to the returns of the previous days (lag-1). How could I do this for the data C? To be more specific, for stock S001 I would like to fill the value for loss data days of 7/4/2012 and 7/12-7/14/2012 (in red colors and to be .2 .21 .21 .21 respectively), but not for days outside the boundaries of 6/26/2012 and 7/22/2012 when the stock are not traded. Thanks and best regards. A B C STOCK DATE RETURN STOCK DATE STOCK DATE RETURN S001 6/21/2012 S001 6/21/2012 S001 6/22/2012 S001 6/22/2012 S001 6/23/2012 S001 6/23/2012 S001 6/24/2012 S001 6/24/2012 S001 6/25/2012 S001 6/25/2012 S001 6/26/2012 S001 6/26/2012 S001 6/27/2012 0.19 S001 6/27/2012 S001 6/27/2012 0.19 S001 6/28/2012 0.19 S001 6/28/2012 S001 6/28/2012 0.19 S001 6/29/2012 0.2 S001 6/29/2012 S001 6/29/2012 0.2 S001 6/30/2012 0.2 S001 6/30/2012 S001 6/30/2012 0.2 S001 7/1/2012 0.21 S001 7/1/2012 S001 7/1/2012 0.21 S001 7/2/2012 0.21 S001 7/2/2012 S001 7/2/2012 0.21 S001 7/3/2012 0.2 S001 7/3/2012 S001 7/3/2012 0.2 S001 7/5/2012 0.19 S001 7/4/2012 S001 7/4/2012 S001 7/6/2012 0.19 S001 7/5/2012 S001 7/5/2012 0.19 S001 7/7/2012 0.19 S001 7/6/2012 S001 7/6/2012 0.19 S001 7/8/2012 0.2 S001 7/7/2012 S001 7/7/2012 0.19 S001 7/9/2012 0.2 S001 7/8/2012 S001 7/8/2012 0.2 S001 7/10/2012 0.21 S001 7/9/2012 S001 7/9/2012 0.2 S001 7/11/2012 0.21 S001 7/10/2012 S001 7/10/2012 0.21 S001 7/15/2012 0.19 S001 7/11/2012 S001 7/11/2012 0.21 S001 7/16/2012 0.2 S001 7/12/2012 S001 7/12/2012 S001 7/17/2012 0.21 S001 7/13/2012 S001 7/13/2012 S001 7/18/2012 0.21 S001 7/14/2012 S001 7/14/2012 S001 7/19/2012 0.21 S001 7/15/2012 S001 7/15/2012 0.19 S001 7/20/2012 0.24 S001 7/16/2012 S001 7/16/2012 0.2 S001 7/21/2012 0.25 S001 7/17/2012 S001 7/17/2012 0.21 S002 6/27/2012 0.19 S001 7/18/2012 S001 7/18/2012 0.21 S002 6/28/2012 0.19 S001 7/19/2012 S001 7/19/2012 0.21 S002 6/29/2012 0.2 S001 7/20/2012 S001 7/20/2012 0.24 S002 6/30/2012 0.2 S001 7/21/2012 S001 7/21/2012 0.25 S002 7/1/2012 0.21 S001 7/22/2012 S001 7/22/2012 S002 7/2/2012 0.21 S001 7/23/2012 S001 7/23/2012 S002 7/3/2012 0.2 S002 6/21/2012 S002 6/21/2012 S002 7/4/2012 0.19 S002 6/22/2012 S002 6/22/2012 S002 7/5/2012 0.19 S002 6/23/2012 S002 6/23/2012 S002 7/6/2012 0.19 S002 6/24/2012 S002 6/24/2012 S002 7/7/2012 0.19 S002 6/25/2012 S002 6/25/2012 S002 7/8/2012 0.2 S002 6/26/2012 S002 6/26/2012 S002 7/9/2012 0.2 S002 6/27/2012 S002 6/27/2012 0.19 S002 7/10/2012 0.21 S002 6/28/2012 S002 6/28/2012 0.19 S002 7/11/2012 0.21 S002 6/29/2012 S002 6/29/2012 0.2 S002 7/15/2012 0.19 S002 6/30/2012 S002 6/30/2012 0.2 S002 7/16/2012 0.2 S002 7/1/2012 S002 7/1/2012 0.21 S002 7/17/2012 0.21 S002 7/2/2012 S002 7/2/2012 0.21 S002 7/18/2012 0.21 S002 7/3/2012 S002 7/3/2012 0.2 S002 7/19/2012 0.21 S002 7/4/2012 S002 7/4/2012 0.19 S002 7/20/2012 0.24 S002 7/5/2012 S002 7/5/2012 0.19 S002 7/21/2012 0.25 S002 7/6/2012 S002 7/6/2012 0.19 S002 7/7/2012 S002 7/7/2012 0.19 S002 7/8/2012 S002 7/8/2012 0.2 S002 7/9/2012 S002 7/9/2012 0.2 S002 7/10/2012 S002 7/10/2012 0.21 S002 7/11/2012 S002 7/11/2012 0.21 S002 7/12/2012 S002 7/12/2012 S002 7/13/2012 S002 7/13/2012 S002 7/14/2012 S002 7/14/2012 S002 7/15/2012 S002 7/15/2012 0.19 S002 7/16/2012 S002 7/16/2012 0.2 S002 7/17/2012 S002 7/17/2012 0.21 S002 7/18/2012 S002 7/18/2012 0.21 S002 7/19/2012 S002 7/19/2012 0.21 S002 7/20/2012 S002 7/20/2012 0.24 S002 7/21/2012 S002 7/21/2012 0.25 S002 7/22/2012 S002 7/22/2012 S002 7/23/2012 S002 7/23/2012
... View more