How to build the excel through datatable by making pairs


I have the particular data in a excel file in img 1(data) which I will filter it from the datatable which I am having then that values after filtering in one column in img2(data1) from that datatable I want to make pairs store it in a excel file which I have provided in img3(data2).
So How I can acheive it and these values are not fix that is the nos will change very time with namedata

Can you please further elaborate because I am unable to get the exact requirement or you can share some dummy files which can help