How to filter excel sheet using Apache POI?
<p>I'm trying to read data from Excel and do some filter based on certain conditions. Based on the result I'm creating new excel file.</p>

<p>I'm using the Apache POI library to read Excel and write an Excel file. I have no issue on that. I want to filter Excel file based on certain condition. Apache POI having a method to filler excel:</p>

<pre><code>s.setAutoFilter(CellRangeAddress.valueOf("A1:N1"));  
</code></pre>

<p>This filter will filter value between the Cell range address A1-N1. But I want to filter Excel sheet based on certain column value.</p>

<p><strong>Sample Table</strong> 
<a href="https://i.stack.imgur.com/d0sb2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d0sb2.jpg" alt="enter image description here"></a></p>

<p>I want to filter based on gender. If the gender is <code>F</code>, I want to create a new excel sheet. How can I filter using Apache POI?</p>