title: Reading Excel file based on 2 conditions in Pythton 3.4
body: <p>I have a excel file that has 5 columns holding player data.</p>
  
  <p>column A: Player name, Column B: Team:, Column C: points, column D, Cost, Column E: position.</p>
  
  <p>I know how to get the price of the player by entering the player name as follows:</p>
  
  <pre><code>from openpyxl import load_workbook
  </code></pre>
  
  <p>print ("Going to execute the Player Choices")</p>
  
  <p>total = {}
  for player in range(4):</p>
  
  <pre><code>player = input("Enter player name")
  wb = load_workbook("LeaguePlayers.xlsx")
  ws = wb.active
  for cell in ws.columns[0]: # get first column
      if cell.value == player:
          cost = ws.cell(row=cell.row, column=4).value
          position = ws.cell(row=cell.row, column=5).value
          print("{0} ({2}) costs {1}".format(player, cost, position))
  
          total[player] = cost
          break
  print("Total Spend is: ",sum(total.values()),"Million")
  
  
  print ("End of player choices")
  print(total)
  </code></pre>
  
  <p>What I want to know is how is it possible to get a players price if the player I have searched for is position "Midfielder" from column E. So just to be clear If I want to get a price for a midfielder and I type Rooney it should look in column E and realise this is not a midfielder and prompt me to enter again until I enter a player who is a midfielder and the price is then displayed.</p>
  
  <p>Any pointers much appreciated.</p>
  
  <p>Thanks  </p>