将 LEFT 嵌入 AVERAGEIFS 公式中
您好,我正在尝试使用 AverageIFS 公式来计算按月和按地区的平均绩效,但我正在努力让它发挥作用。
我可以让它作为单独的 IF 函数工作,但放在一起它只是返回#VALUE!
单元格 C28 中的公式为 =AVERAGEIFS(2:25,BDPercentage[[#All],[Territory]],$B28,2:2,LEFT(C27,3)&"*")
请参阅单元格 C30,我设法使用此代码将表格第一行的一月平均化=AVERAGEIF(2:2,LEFT(C27,3)&"*",3:25)
,尽管即使这样也只是返回表格的顶行,而我本以为它会计算一月份所有可用数据的平均值?
注意: 屏幕截图中的表格称为“BDPercentage” 第 2 行由日期字段组成
Hi I'm trying to use an AverageIFS formula to work out the average performance by month and by territory but I'm struggling to get it to work.
I can get it to work as individual IF functions but together it's just returning #VALUE!
The formula seen in cell C28 is =AVERAGEIFS(2:25,BDPercentage[[#All],[Territory]],$B28,2:2,LEFT(C27,3)&"*")
See in Cell C30 I manage to get it to Average just the Januarys for the first line of the table using this code =AVERAGEIF(2:2,LEFT(C27,3)&"*",3:25)
, although even that is just returning the top line of the table when I would have thought it would average all the data available for January?
NOTES:
The table in the screenshot is called "BDPercentage"
Row 2 consists of Date fields
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回复:您的主要目标:
将日期标题格式化为日期,即:
(日期无关紧要)
接下来,使用以下公式计算平均值(很多)不同的方式,这只是其中之一......按预期工作):
注意:
let
函数需要 Office 365 兼容性;如果您使用旧版本的 Excel,则省略 let 函数并将x_
替换为(MONTH($E$3:$W$3)=COLUMNS($E14:E14))*($ D$4:$D$10=$D14)
...即两个替换...RE:使用
averageifs
- @Tom Sharpe 似乎在评论中解决了适用性问题。如果您的目标是使用averageifs来使其工作,那么(尽管有用例) - 您仍然可以使用averageifs
,但需要包含index
或过滤
以确保标准和值范围之间的维度一致...RE: your primary objective:
Format your date headers as date i.e.:
(day is irrelevant)
Next, use following formula to calculate averages (lot's of different ways, this is but one of them...which works as intended):
Caveat: the
let
function reqiures Office 365 compatibility; if you have an older version of Excel then omit the let function and substitutex_
with(MONTH($E$3:$W$3)=COLUMNS($E14:E14))*($D$4:$D$10=$D14)
...i.e. two substitutions...RE: using
averageifs
- @Tom Sharpe appears to have addressesd suitability in commentary. If your objective is fixated upon using averageifs to get this to work then (notwithstanding a use case) - you can still useaverageifs
but would need to include anindex
orfilter
within to ensure dimensionality consistent between criteria and value ranges...