perform filter operation in excel

hi friends,

i have to perform below task.

i have a collection containing fields like SNO,EMPLOYEE, SALARY,ID,COUNTRY.
Now i want write this collection data into an excel file , before data insertion i need to filter the data based on country.
Suppose country = india then bot first will check any sheet containing name with india , if yes then insert that particular country related data into the india sheet. if the sheet doesn't available first bot will create the sheet with the name india and perform insertion operation.
Moreover we doesn't know how many countrys are there in collection field.

How to build logic for this task ?
please help me on this
 
Top