I have an excel sheet. I want to write a method which takes parameter as column number that to be read and return a array consist of all the data in that column.
And then to place that column element in xml sheet. How can I write a method to do that?
Use Apache POI. You can find example in their usage page.
You may find this answer helpful: How to get columns from Excel files using Apache POI
That has all the code you need to extract all the numeric values from one column, whether they're a number cell or a formula cell containing a number result. I suspect you'll need something like that.