 <ol> <li>Prepare a dictionary to store the results.</li> <li>Get the numbers of line with data you have using xlrd, then iterate over each of them. </li> <li>For each state code, if it's not <code>in</code> the dict, you create it also as a dict.</li> <li><p>Then you check if the entry you read on the second column exists within the state key on your results dict.</p> <p>4.1 If it does not, you'll create it also as a dict, and add the number found on the second column as a key to this dict, with a value of one.</p> <p>4.2 If it does, just increment the value for that key (+1).</p></li> </ol> <p>Once it has finished looping, your result dict will have the count for each individual entry on each individual state.</p>