$ 0 0 Hi I have updated it as follows: following are the resultsnow as per the logic I believe it should only take the last two pairsbut if I look at the out put it is still getting the wrong results Regards