Dear John H.Davis,

Thank for the quick response...
but the code is not giving the required output... pls help me by doing some modifications... for easy understanding of the output, please refer the attached excel file, in that I did manually...