求和范围和标准切换

sumif range and criteria switching

所以我一年中有 table 个财政周数,为了计算折旧,我试图对资本投资总生命周期中的周数求和。所以第一个参数是范围,第二个参数从另一个单元格中提取年份,然后添加设备的预期寿命(以年为单位)。第三个参数是预期的总和范围。

SUMIF(YearWeeks[Year],"<="&LEFT(AS,4)+$H20,YearWeeks[Weeks])

这很好用。拉入正确的数字没问题。 但是,每当我尝试将其拖过其他单元格以便在整个电子表格中使用它来计算折旧时,它都会立即切换年份值和周值并变为:

SUMIF(YearWeeks[Weeks],"<="&LEFT(AU,4)+$H20,YearWeeks[Year])

我不明白为什么要这样做。这可能是一些简单的事情,但它完全在逃避我。任何帮助将不胜感激。

Year Weeks 2015 52 2016 53 2017 52 2018 52 2019 52 2020 52 2021 53 2022 52 2023 52 2024 52 2025 52 2026 52 2027 53 2028 52 2029 52 2030 52

Life

5
5
5
5
5
5
5
5
8
8
8
8
8
8

201504  201505  201506  201507  201508  201509  201510  201511  201512  201601  201602  201603

不要将公式拖到右边,而是复制单元格并将其粘贴到它右边的单元格中,等等...:[=​​15=]

这将使列引用保持不变(从 YearWeeks[Weeks]YearWeeks[Year] 没有变化)。

Microsoft's support website 所述:

Moving, copying, and filling structured references

All structured references remain the same when you copy or move a formula that uses a structured reference.

When you fill a formula, fully qualified structured references can adjust the column specifiers like a series as summarized in the following table.

注意:YearWeeks[Weeks] 是结构化引用,fill 是许多人在这种情况下所说的 drag