title: Access data from excel in single column using Apache POI
body: <p><a href="https://i.stack.imgur.com/9tcyJ.png" rel="nofollow noreferrer">My input data</a></p>
  
  <ol>
  <li>I have attached an Excel column with few rows</li>
  <li>Number 445.04 is repeated thrice in this column.</li>
  <li>I have to write a logic in java which will help me iterate through this column with 200+ rows and add these type of values will result in zero. </li>
  <li>The numbers can be different, take up any value where the possibility of them when operated can result in zero.</li>
  <li><a href="https://i.stack.imgur.com/vlFZY.png" rel="nofollow noreferrer">Here's another picture with different scenerio</a></li>
  <li>In the above, 10 and -3-7 when added can be made zero and also 5 and -5 can also be made zero.
  7.How can i write the code which can access a single column for this type of scenario? Leave a comment if anything additional is required.</li>
  </ol>
  
  <p>This is what I'm trying to achieve...the output can be printed on console of the IDE instead in the excel itself</p>
  
  <p><a href="https://i.stack.imgur.com/KMoBV.png" rel="nofollow noreferrer">Expected result</a></p>
  
  <hr>
  
  <pre><code>    Iterator&lt;Row&gt; iterator = firstSheet.iterator();
      List&lt;Double&gt; posValue = new ArrayList&lt;Double&gt;();
      List&lt;Double&gt; negValue = new ArrayList&lt;Double&gt;();
      while(iterator.hasNext())//goes down the row, until there is nothing
      {    
          Row nexRow = iterator.next();
          if(nexRow.getRowNum()!=0){
              value = nexRow.getCell(3).getNumericCellValue();
  
              if(value&gt;0){
                  posValue.add(value);
              }
              else if(value &lt;0){
                  //System.out.println("ehre");
                  negValue.add(value);
              }
          }
          Iterator&lt;Double&gt; pIterator = posValue.iterator();
          Iterator&lt;Double&gt; nIterator = negValue.iterator();
  
          for(int i = 0; i&lt;posValue.size();i++){
              for(int j=0; j&lt;negValue.size(); j++){
                  //System.out.println(negValue.get(j));
                  result= posValue.get(i)+negValue.get(j);
              }
          }
          if(result==0){
              System.out.println(result+"    "+nexRow.getRowNum());
          }
          workbook.close();
          inputStream.close();
      }
  </code></pre>
  
  <p>I thought of this because I have to calculate the values on the basis their signs and make it zero. </p>