Sure. I apologize if I have not been clear in my explanation.
The first screenshot showing the field GRIDCODE has a number of corresponding FID_XXXX. Each GRIDCODE has a row of data which holds FID_XXXX values which I need to summarize. for example in case of GRIDCODE=0 ,the new field TOTAL_AREA_OVERLAP will hold sum of all (FID_5194+FID_5203+.....)
Since there are a large number of such columns and there is no fixed range for the FID_XXXX property I need to run a loop for summing the values in all columns starting with string FID_% for each row and populate that value inside TOTAL_AREA_OVERLAP. Summing is one of the operation I need. Similar to this I may also need mean, median etc as well.
Hope this helps. Thank you.