使用 Median 和 Group by and where google 表查询

Query with Median and Group by and where google sheets

我需要得到分组的中位数

我已经对形式的数据进行了分组

From    type                 Weight
A       person-person        4
A       person-person        3
A       person-organization  11
A       person-person        5
A       person-organization  6
B       person-person        2
B       person-organization  3
B       person-organization  7
C       person-person        5
C       person-person        2
C       person-organization  15
S       person-organization  7
S       person-person        4
S       person-person        3

我需要得到按 A 列分组的中位数,其中 B 列 = 'person-person'

A   value1
B   value2
C   value3
S   value4

我可以通过以下方式对平均值执行此操作:

=QUERY(Connections!A:C,"Select A, Avg(C) where B='person-person' and C is not null group by A",1)

我试过使用 Median 函数,但我无法将其按 A 列分组

Google sheet https://docs.google.com/spreadsheets/d/1ZPia3LkVg2Pt4YGIH4KtW49G2uElRFcvWLY6LYOQ-Ss/edit?usp=sharing

这样可以得到中位数吗?

谢谢

不幸的是,在 Google Sheets 中,QUERY(也不 ARRAYFORMULA)函数根本不支持中位数。


可拖动解决方案:

=MEDIAN(FILTER(C:C, A:A=H2))