使用 INDIRECT 引用 COUNTIFS/SUMIF(S) 公式中的单元格范围(发生错误)
Using INDIRECT to refer to a cell range within a COUNTIFS/SUMIF(S) formula (Error occuring)
下面的公式有效,我正在尝试使用 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)]
编辑范围
我尝试这样做,但 COUNTIFS
的答案是 #VALUE!
,SUMIF
的答案是 130206 而不是 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)
有人可以告诉我我哪里出错了,并帮助我让它正常工作吗?
谢谢
也尝试放置该列,因为考虑到您的解释:
"the values used in the INDIRECT formula are B6 = Other materials (The work sheet on which the data resides), B7 = 2 (The row on which data starts, this shouldn't change), B8 = 344"
您的公式如下所示:"Other materials'!2:344"
所以值应该是:B7 = "B2" 和 B8="B344",例如
下面的公式有效,我正在尝试使用 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)]
我尝试这样做,但 COUNTIFS
的答案是 #VALUE!
,SUMIF
的答案是 130206 而不是 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)
有人可以告诉我我哪里出错了,并帮助我让它正常工作吗?
谢谢
也尝试放置该列,因为考虑到您的解释:
"the values used in the INDIRECT formula are B6 = Other materials (The work sheet on which the data resides), B7 = 2 (The row on which data starts, this shouldn't change), B8 = 344"
您的公式如下所示:"Other materials'!2:344"
所以值应该是:B7 = "B2" 和 B8="B344",例如