title: Filter an Excel file and output the result into another Excel
body: <p>I am currently doing a small project for a club in my school. The idea is to filter the GPA of students if they are above a cutoff point based on their class (Freshmen, Sophomore, Junior, and Senior).</p>
  
  <p>Here's an easy example; let's say I have the following .xlsx file:</p>
  
  <p><a href="https://i.stack.imgur.com/uwZCI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uwZCI.png" alt="GPA1"></a></p>
  
  <p>So based on their credit hours they are part of a class. If they have <code>x &lt; 30</code> Credits they are a Freshmen, <code>x =&lt; 59 &amp;&amp; x &gt;= 30</code> they are a sophomore, <code>x =&lt; 89 &amp;&amp; x &gt;= 60</code> they are a junior, and if they have <code>x &gt;= 90</code> credits they are a senior.</p>
  
  <p>So the cut off for the GPA is different for each class. These are the cut offs:</p>
  
  <ul>
  <li>(<code>x &lt; 30</code>)Freshmen: 1.5</li>
  <li>(<code>x =&lt; 59 &amp;&amp; x &gt;= 30</code>)Sophomore: 2.0</li>
  <li>(<code>x =&lt; 89 &amp;&amp; x &gt;= 60</code>)Junior: 2.5</li>
  <li>(<code>x &gt;= 90</code>)Senior: 3.0</li>
  </ul>
  
  <p>So in our case if we were to filter this data our output would be:</p>
  
  <p><a href="https://i.stack.imgur.com/5zDFJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5zDFJ.png" alt="GPA2"></a></p>
  
  <p>I've been learning how to use xlsxwriter but I'm not sure if there's an easier way to filter something this simple.</p>
  
  <p>I just need to understand how to read the data from this inputted Excel file and read the correct column to filter.</p>
  
  <p>This is a way I believe could work in order to filter (just a pseudo code I mocked up): </p>
  
  <pre><code> for row_line in credits_column:
          grade_level = column_line[1] #This would be our Credits Column
          #check the grade level
          #Check if they're a Senior
          if grade_level &gt;= 90:
              if gpa_level &gt;= 3.0:
                  #Keep this row!
              else:
                  #Hide/Delete this row!
          #Check if they're a Junior
          elif grade_level =&lt; 89 &amp;&amp; grade_level &gt;= 60:
              if gpa_level &gt;= 2.5:
                  #Keep this row!
              else:
                  #Hide/Delete this row!
  
          elif grade_level =&lt; 59 &amp;&amp; grade_level &gt;= 30:
              if gpa_level &gt;= 2.0:
                  #Keep this row!
              else:
                  #Hide/Delete this row!
  
          elif grade_level &lt; 30:
              if gpa_level &gt;= 1.5:
                  #Keep this row!
              else:
                  #Hide/Delete this row.
          # Move on to the next worksheet row.
          row += 1
  </code></pre>
  
  <p>How could I grab the information on both the Credit Column and GPA column correctly, then filter?</p>