1

在 Google 表格中,我一直在处理不同价格的数据集,以将它们与实际成本进行比较,并排除正常范围之外的值。我以前得到过帮助,但我无法根据我得到帮助的原始公式设计更多公式。

在我的数据集中,我有非常大的扩展数据集,我手动输入了多个数字重复出现的地方。我已经用多个值标记了每个值,value (x)因为 X 表示数据集中出现的数量或总数,以使其更小;因为我需要手动输入每个

计算平均值的公式如下:

=ARRAYFORMULA(SUM(QUERY(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
 IF(ISNUMBER(A19:AP19), "♦"&A19:AP19&" 1", IF((A19:AP19<>"")*(NOT(ISNUMBER(A19:AP19))), "♦"&REGEXREPLACE(A19:AP19, "[()]", ), ))),,99^99)),,99^99), "♦")), " "), 
 "select Col1*Col2 label Col1*Col2 ''", 0))/SUM(QUERY(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
 IF(ISNUMBER(A19:AP19), "♦"&A19:AP19&" 1", IF((A19:AP19<>"")*(NOT(ISNUMBER(A19:AP19))), "♦"&REGEXREPLACE(A19:AP19, "[()]", ), ))),,99^99)),,99^99), "♦")), " "), 
 "select Col2", 0)))

这非常有效。我还有一个计算数据集的最小值和最大值的公式。

我试图编辑代码以给自己模式(不会读取value (x)值)和 IQR(四分位距),但绝对没有成功。

我希望能够在使用使用标记的值时找到数据集的标准偏差、平均偏差和 IQRvalues (x)

以下是数据集示例的链接: https ://docs.google.com/spreadsheets/d/15-UY7salQ8fI011twnIKSjEJQWCSVmfV1wErE28gvKw/edit?usp=sharing

4

2 回答 2

1

解决方案

Google 表格为这些统计变量提供了自定义公式。使用这些如下:

我希望这对你有所帮助。让我知道您是否需要其他任何内容,或者您​​是否不理解某些内容。:)

于 2020-02-27T11:34:42.527 回答
1

基本公式(采用您的范围B14:B并扩展格式中的所有值value (x)

=ARRAYFORMULA(TRANSPOSE(SPLIT(QUERY(REPT(
 INDEX(IF(B14:B="",,SPLIT(IF(ISNUMBER(B14:B), B14:B&" 1", B14:B), " ()"))*1,,1)&"♦&quot;, 
 INDEX(IF(B14:B="",,SPLIT(IF(ISNUMBER(B14:B), B14:B&" 1", B14:B), " ()"))*1,,2)),,999^99), "♦&quot;)))

0


平均(B3)

=ARRAYFORMULA(SUM(QUERY(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
 IF(ISNUMBER(B14:B), "♦&quot;&B14:B&" 1", IF((B14:B<>"")*(NOT(ISNUMBER(B14:B))), 
 "♦&quot;&REGEXREPLACE(B14:B, "[()]", ), ))),,99^99)),,99^99), "♦&quot;)), " "), 
 "select Col1*Col2 label Col1*Col2 ''", 0))/
 SUM(QUERY(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
 IF(ISNUMBER(B14:B), "♦&quot;&B14:B&" 1", IF((B14:B<>"")*(NOT(ISNUMBER(B14:B))), 
 "♦&quot;&REGEXREPLACE(B14:B, "[()]", ), ))),,99^99)),,99^99), "♦&quot;)), " "), 
 "select Col2", 0)))

范围 (B4)

=B7-B8

中位数 (B5)

=ARRAYFORMULA(MEDIAN(TRANSPOSE(SPLIT(QUERY(REPT(
 INDEX(IF(B14:B="",,SPLIT(IF(ISNUMBER(B14:B), B14:B&" 1", B14:B), " ()"))*1,,1)&"♦&quot;, 
 INDEX(IF(B14:B="",,SPLIT(IF(ISNUMBER(B14:B), B14:B&" 1", B14:B), " ()"))*1,,2)),,999^99), "♦&quot;))))

模式 (B6)

=ARRAYFORMULA(MODE(TRANSPOSE(SPLIT(QUERY(REPT(
 INDEX(IF(B14:B="",,SPLIT(IF(ISNUMBER(B14:B), B14:B&" 1", B14:B), " ()"))*1,,1)&"♦&quot;, 
 INDEX(IF(B14:B="",,SPLIT(IF(ISNUMBER(B14:B), B14:B&" 1", B14:B), " ()"))*1,,2)),,999^99), "♦&quot;))))

最大 (B7)

=ARRAYFORMULA(MAX(QUERY(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(B14:B)
,,99^99)),,99^99), " ")), "where not Col1 contains '-'", 0)))

最低 (B8)

=ARRAYFORMULA(MIN(QUERY(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(B14:B)
,,99^99)),,99^99), " ")), "where not Col1 contains '-'", 0)))

IQR - 四分位距 (B9)

=ARRAYFORMULA(QUARTILE(TRANSPOSE(SPLIT(QUERY(REPT(
 INDEX(IF(B14:B="",,SPLIT(IF(ISNUMBER(B14:B), B14:B&" 1", B14:B), " ()"))*1,,1)&"♦&quot;, 
 INDEX(IF(B14:B="",,SPLIT(IF(ISNUMBER(B14:B), B14:B&" 1", B14:B), " ()"))*1,,2)),,999^99), "♦&quot;)), 3)-
 QUARTILE(TRANSPOSE(SPLIT(QUERY(REPT(
 INDEX(IF(B14:B="",,SPLIT(IF(ISNUMBER(B14:B), B14:B&" 1", B14:B), " ()"))*1,,1)&"♦&quot;, 
 INDEX(IF(B14:B="",,SPLIT(IF(ISNUMBER(B14:B), B14:B&" 1", B14:B), " ()"))*1,,2)),,999^99), "♦&quot;)), 1))

平均偏差 (B10)

=ARRAYFORMULA(AVEDEV(TRANSPOSE(SPLIT(QUERY(REPT(
 INDEX(IF(B14:B="",,SPLIT(IF(ISNUMBER(B14:B), B14:B&" 1", B14:B), " ()"))*1,,1)&"♦&quot;, 
 INDEX(IF(B14:B="",,SPLIT(IF(ISNUMBER(B14:B), B14:B&" 1", B14:B), " ()"))*1,,2)),,999^99), "♦&quot;))))

标准偏差 (B11)

=ARRAYFORMULA(STDEV(TRANSPOSE(SPLIT(QUERY(REPT(
 INDEX(IF(B14:B="",,SPLIT(IF(ISNUMBER(B14:B), B14:B&" 1", B14:B), " ()"))*1,,1)&"♦&quot;, 
 INDEX(IF(B14:B="",,SPLIT(IF(ISNUMBER(B14:B), B14:B&" 1", B14:B), " ()"))*1,,2)),,999^99), "♦&quot;))))
于 2020-02-27T17:34:01.253 回答