(1) The department shall calculate basic funding for each district as provided in this section.

(2) For state aid calculated for school fiscal years prior to school fiscal year 2011-12:

(a) A comparison group shall be established for each district consisting of the districts for which basic funding is being calculated, the five larger districts that are closest in size to the district for which basic funding is being calculated as measured by formula students, and the five smaller districts that are closest in size to the district for which basic funding is being calculated as measured by formula students. If there are not five districts that are larger than the district for which basic funding is being calculated or if there are not five districts that are smaller than the district for which basic funding is being calculated, the comparison group shall consist of only as many districts as fit the criteria. If more than one district has exactly the same number of formula students as the largest or smallest district in the comparison group, all of the districts with exactly the same number of formula students as the largest or smallest districts in the comparison group shall be included in the comparison group. If one or more districts have exactly the same number of formula students as the district for which basic funding is being calculated, all such districts shall be included in the comparison group in addition to the five larger districts and the five smaller districts. The comparison group shall remain the same for the final calculation of aid pursuant to section 79-1065;

(b) For districts with nine hundred or more formula students, basic funding shall equal the formula students multiplied by the average of the adjusted general fund operating expenditures per formula student for each district in the comparison group, excluding both the district with the highest adjusted general fund operating expenditures per formula student and the district with the lowest adjusted general fund operating expenditures per formula student of the districts in the comparison group; and

(c) For districts with fewer than nine hundred formula students, basic funding shall equal the product of the average of the adjusted general fund operating expenditures for each district in the comparison group, excluding both the district with the highest adjusted general fund operating expenditures and the district with the lowest adjusted general fund operating expenditures of the districts in the comparison group.

(3) For state aid calculated for school fiscal year 2011-12 and each school fiscal year thereafter:

(a) A comparison group shall be established for each district consisting of the districts for which basic funding is being calculated, the ten larger districts that are closest in size to the district for which basic funding is being calculated as measured by formula students, and the ten smaller districts that are closest in size to the district for which basic funding is being calculated as measured by formula students. If there are not ten districts that are larger than the district for which basic funding is being calculated or if there are not ten districts that are smaller than the district for which basic funding is being calculated, the comparison group shall consist of only as many districts as fit the criteria. If more than one district has exactly the same number of formula students as the largest or smallest district in the comparison group, all of the districts with exactly the same number of formula students as the largest or smallest districts in the comparison group shall be included in the comparison group. If one or more districts have exactly the same number of formula students as the district for which basic funding is being calculated, all such districts shall be included in the comparison group in addition to the ten larger districts and the ten smaller districts. The comparison group shall remain the same for the final calculation of aid pursuant to section 79-1065;

(b) For districts with nine hundred or more formula students, basic funding shall equal the formula students multiplied by the average of the adjusted general fund operating expenditures per formula student for each district in the comparison group, excluding both the two districts with the highest adjusted general fund operating expenditures per formula student and the two districts with the lowest adjusted general fund operating expenditures per formula student of the districts in the comparison group; and

(c) For districts with fewer than nine hundred formula students, basic funding shall equal the product of the average of the adjusted general fund operating expenditures for each district in the comparison group, excluding both the two districts with the highest adjusted general fund operating expenditures and the two districts with the lowest adjusted general fund operating expenditures of the districts in the comparison group.