Maybe an easier approach to this problem is to create a code

I have a list of 10 digits (0 through 9) in ET70:ET79.

I have listed in EU70:EU79 how many times each digit has

been entered in the last 12 data rows.

I want a code that pick from the ET column which 3 digits have the highest occurrences

in the EU column, and place answer in EV71.

Also,

I want a code that pick from the ET column which 3 digits have the lowest occurrences

in the EU column, and place answer in EX71.

Also,

I want a code that pick from the ET column which 4 digits are neither the highest nor

the lowest occurrences in the EU column, and place answer in EW71.

The problem is whenever this list is updated some of the 0 through 9 digits

have equal occurrences, so the key is to a keep a near balanced output from the 3 cells

(3 digits highest, 4 digits in the middle and 3 digit lowest). I need to prevent

the 3 cells EV71:EW71 from having less than 2 digits and no more than 5 digits

as a return answer in any of the cells. Also, if one has 2 digit answer returned,

then the other 2 cells can return either (the remaining 2 cells have 4 digit

answer) or (one cell has 3 digit answer and the other 5 digit answer).

Therefore, the valid amount of digit combination answers for all 10 digits returned in

the 3 cells in any order is the following:

2 digits-5 digits-3 digits (idea) example: EV71=03, EW71=96815, EX71=274

or

4 digits-2 digits-4 digits (idea) example: EV71=0396, EW71=15, EX71=2748

or

3 digits-4 digits-3 digits (idea) example: EV71=039, EW71=8156, EX71=274

Example

digits...Occurrences......Highest.....Middle......Lowest

EU.........EV...............EX71.......EW71........EX71

0.......... 2

1.......... 3................2865.......149...........370

2.......... 6

3.......... 1

4.......... 4

5.......... 3

6.......... 5

7.......... 1

8.......... 6

9.......... 5