How to read multiple sensors, store into an array, sort and then do something with the results—Arduino
So, your question about how to sort this and do something with it is a general programming question, not specifically an Arduino question.

There's many ways to skin this cat.  The way I'd do it would be to define a structure with everything about the battery that I wanted to know -- let's assume it's just the voltage and physical position:

struct BatteryDescriptor {
  float voltage;
  unsigned int position;
};


I would make an array of that structure, one per battery.  Then I'd sort that array on voltage.  There are a lot of ways to do this.  If you have a full C library available you can use qsort.  I'm assuming you don't have the STL library available.  Finally, you can roll your own.

There are a LOT of sorting algorithms out there.  Because you're only sorting eight things, and you're a beginner, I recommend a bubble sort.  Google it.  Further, I recommend that you do the sorting in place (as opposed to making an array of pointers to your array of descriptors, or making your descriptors into a linked list).

When you're done, you should have the four highest-voltage batteries at the beginning or end of your list.  You can step through that with a for loop and turn on your LEDs.