Excel 中的偏移值 - 偏移公式似乎不是正确的用例
Offset values in Excel - Offset formula does not seem to be the correct use case
我已经研究了 Excel 偏移公式,但我不太确定它是否是用于我的特定问题的正确公式。
我有一个 excel 来源 table 如下所示:
Month 0
Month 1
Month 2
Month 3
January
100
120
150
180
February
200
220
250
March
300
320
April
400
但是,我想要实现的是获得第二个 table,其中与上一行相比,每一行都偏移了一个额外的单元格。结果应如下所示:
Month 0
Month 1
Month 2
Month 3
January
100
120
150
180
February
200
220
250
March
300
320
April
400
在 Excel 中有没有一种方法可以通过引用来源 table 的公式来实现这一点?
谢谢!
假设您的单元格 January
是单元格 A2,请尝试使用公式:
=IFERROR(N(OFFSET(B2, 0, -ROW(B2)+2)), "")
它并不完美,因为它将零放在偏移行的开头(中间没有 N(...)
公式,它会把月份名称放在那里)但它可能足以满足您的目的?
如果您的来源 table 不在屏幕顶部,您必须调整 +2
进行补偿,尝试一下。
EDIT 刚刚意识到用 NUMBERVALUE
替换 'N' 可以去掉零:=IFERROR(NUMBERVALUE(OFFSET(B2, 0, -ROW(B2)+2)), "")
我已经研究了 Excel 偏移公式,但我不太确定它是否是用于我的特定问题的正确公式。
我有一个 excel 来源 table 如下所示:
Month 0 | Month 1 | Month 2 | Month 3 | |
---|---|---|---|---|
January | 100 | 120 | 150 | 180 |
February | 200 | 220 | 250 | |
March | 300 | 320 | ||
April | 400 |
但是,我想要实现的是获得第二个 table,其中与上一行相比,每一行都偏移了一个额外的单元格。结果应如下所示:
Month 0 | Month 1 | Month 2 | Month 3 | |
---|---|---|---|---|
January | 100 | 120 | 150 | 180 |
February | 200 | 220 | 250 | |
March | 300 | 320 | ||
April | 400 |
在 Excel 中有没有一种方法可以通过引用来源 table 的公式来实现这一点?
谢谢!
假设您的单元格 January
是单元格 A2,请尝试使用公式:
=IFERROR(N(OFFSET(B2, 0, -ROW(B2)+2)), "")
它并不完美,因为它将零放在偏移行的开头(中间没有 N(...)
公式,它会把月份名称放在那里)但它可能足以满足您的目的?
如果您的来源 table 不在屏幕顶部,您必须调整 +2
进行补偿,尝试一下。
EDIT 刚刚意识到用 NUMBERVALUE
替换 'N' 可以去掉零:=IFERROR(NUMBERVALUE(OFFSET(B2, 0, -ROW(B2)+2)), "")