'湖北新高考案等级分自定义 折合分函数 Zhehefeng(Yuanshifeng, Quyu);参数分别为学生个体 原始分-相对引用,数据区域-绝对引用
Function Zhehefeng(Yuanshifeng, Quyu)
minci = Application.WorksheetFunction.Rank(Yuanshifeng, Quyu)
dengji = minci / Application.WorksheetFunction.CountA(Quyu)
Select Case dengji
Case 0 To 0.15
dengji = "A"
x1 = 86: x2 = 100
y1 = Application.WorksheetFunction.Large(Quyu, 0.15 * Application.WorksheetFunction.CountA(Quyu))
y2 = Application.WorksheetFunction.max(quyu)
Case 0.15 To 0.5
dengji = "B"
x1 = 71: x2 = 85
y1 = Application.WorksheetFunction.Large(Quyu, 0.5 * Application.WorksheetFunction.CountA(Quyu))
y2 = Application.WorksheetFunction.Large(Quyu, 0.15 * Application.WorksheetFunction.CountA(Quyu))
Case 0.5 To 0.85
dengji = "C"
x1 = 56: x2 = 70
y1 = Application.WorksheetFunction.Large(Quyu, 0.85 * Application.WorksheetFunction.CountA(Quyu))
y2 = Application.WorksheetFunction.Large(Quyu, 0.5 * Application.WorksheetFunction.CountA(Quyu))
Case 0.85 To 0.98
dengji = "D"
x1 = 41: x2 = 55
y1 = Application.WorksheetFunction.Large(Quyu, 0.98 * Application.WorksheetFunction.CountA(Quyu))
y2 = Application.WorksheetFunction.Large(Quyu, 0.85 * Application.WorksheetFunction.CountA(Quyu))
Case Is > 0.98
dengji = "E"
x1 = 30: x2 = 40
y1 = Application.WorksheetFunction.min(Quyu))
y2 = Application.WorksheetFunction.Large(Quyu, 0.98 * Application.WorksheetFunction.CountA(Quyu))
End Select
y = Yuanshifeng
if y2=y1 then
zhehefeng=x1
else
Zhehefeng = Int((x2 * (y - y1) + x1 * (y2 - y)) / (y2 - y1) + 0.5)
end if
End Function