使用INDIRECT引用COUNTIFS / SUMIF(S)公式中的单元格区域(发生错误)

时间:2017-03-09 11:51:21

标签: excel countif sumifs excel-indirect

以下公式有效,我正在尝试使用INDIRECT更改此设置,以便能够更改单元格区域,以便更新。

=SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!L2:L344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!N2:N344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!P2:P344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!R2:R344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!T2:T344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!V2:V344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!X2:X344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!Z2:Z344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!AB2:AB344)

我想替换['Other materials'!B2:B344]['Other materials'!X2:Y344)],并能够使用此[=INDIRECT("'" & B6 & "'!" & B7 & ":" & B8)]

编辑范围

我尝试这样做,但#VALUE!和130206的答案为COUNTIFSSUMIF的答案为122而不是122。

SUMIF where substituted:=SUMIF((INDIRECT("'" & B6 & "'!" & B7 & ":" & B8)), "*Germany*", 'Other materials'!L2:L344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!N2:N344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!P2:P344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!R2:R344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!T2:T344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!V2:V344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!X2:X344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!Z2:Z344)+SUMIF('Other materials'!B2:B344, "*Germany*", 'Other materials'!AB2:AB344)

有人可以告诉我出错的地方并帮助我让它正常工作吗?

由于

1 个答案:

答案 0 :(得分:0)

尝试将列放入,因为考虑到您的解释:

“INDIRECT公式中使用的值是B6 =其他材料(数据所在的工作单),B7 = 2(数据开始的行,不应更改),B8 = 344”< / p>

你的公式如下:“其他材料'!2:344”

所以值应为:B7 =“B2”,B8 =“B344”,例如