Hi Suchitra, and greetings from this side of the Missippi.
I hope, given the time elapsed that you found a solution to this
query. By means of introduction to the group I am attaching one
solution. The Data, Consolidation feature of excel sounds like will
solve your scenario. I have attached an example file (with solution
illustrated) in the files section of this group.
'Consolidate_Example.xls'