各位大神帮忙看下,如何处理这个数据
成绩分析,要求找出语文、数学、英语各科分数前30%和物理、化学、生物、政治、历史、地理各科分数前15%的人分布在各个班的个数=SUMPRODUCT((各科成绩!$A$2:$A$1647=$A4)*(OFFSET(各科成绩!$A$2:$A$1647,,MATCH($C4,各科成绩!$A$1:$R$1,)-1)>=LARGE(OFFSET(各科成绩!$A$2:$A$1647,,MATCH($C4,各科成绩!$A$1:$R$1,)-1),COUNTA(各科成绩!$A$2:$A$1647)*30%))) =COUNTIFS(各科成绩!A:A,A4,OFFSET(各科成绩!A:A,,MATCH(C4,各科成绩!$1:$1,)-1),">="&PERCENTILE(OFFSET(各科成绩!A:A,,MATCH(C4,各科成绩!$1:$1,)-1),0.85-0.15*OR(C4={"语文","数学","英语"})))
-- 前面30% = 1645 * 0.3 = 前494名
select a.jb,b.语文人数,c.数学人数,d.英语人数,e.物理人数 from ((([各科成绩$] a
left join
(
select jb,count(xm) as 语文人数 from
(
select top 494 * from [各科成绩$]
order by 语文 desc
)
group by jb
order by jb
) b on b.jb=a.jb)
left join
(
select jb,count(xm) as 数学人数 from
(
select top 494 * from [各科成绩$]
order by 数学 desc
)
group by jb
order by jb
) c on c.jb=a.jb)
left join
(
select jb,count(xm) as 英语人数 from
(
select top 494 * from [各科成绩$]
order by 英语 desc
)
group by jb
order by jb
) d on d.jb=a.jb)
left join
(
select jb,count(xm) as 物理人数 from
(
select top 494 * from [各科成绩$]
order by 物理 desc
)
group by jb
order by jb
) e on e.jb=a.jb 谢谢上面几位,刚学习函数,多谢了 刚测试了下,前面两位的统计语数英可以,但后面6科选科的好像结果出错,统计出来的数据不对 多谢谢上面大神的回复,语文数学英语三科都可以实现,但物理开始就出错,(哪图标题弄错了,是前15%)
页:
[1]