How Can I Automate The Following: Sort an entire table based on one column, and then count the values in another column

excel
python
sorting

#1

Up until now I’ve only used Excel, but I’m having a problem that I don’t think Excel can solve.

I have a table, and the very first column includes one of two values ( “1” if the observation is successful, and a “0” if the observation is unsuccessful). All the other columns include numerical values for the features/explanatory varaibles.

What I’m doing now (by hand) is sorting the entire table based on the numerical values of each feature column, and as soon as the entire table is sorted, I count how many occurances of “0” there are within a range ONLY in the first column. I do not count the entire first column, only a ceratin range. After counting the occurances, I input the count value into a separate spreadsheet, and then I repeat the process with all the other features.

The problem is that I have 1,700 features/columns, and it’s taking me 6 days total to go through all 1,700 columns. What program can I use to automate this simple process of sorting based on one column, and then counting the occurances withing a range in another column?

Here’s a 2-minute long video of what I’m trying to achieve: https://youtu.be/XYwkW9l3eBI