Hi Thanks very much. Formula is working.
=IF(ISNA(MATCH(B2,B$1:B1,0)), 0, 1 - (INDEX(D$1:D1, MAX(IF(B2 = B$1:B1,ROW(B$1:B1)-MIN(ROW(B$1:B1))+1))) = D2))
But by this formula, I am able to find only the person who is gaining allocation not losing allocation. I also want to find the person who is losing allocation. if a person gains allocation other person will lose allocation.
Also there is one drawback - This file will not work in large row of data more than 30000 rows. if it is not possible to make a faster formula That's not an issue I will do it in parts.
Last time u have mentioned to provide sample data. which has hundreds or even thousands of rows of data. Please find attached the sample data.