将值从上一行返回到当前行 [英] Return values from the row above to the current row

查看:93
本文介绍了将值从上一行返回到当前行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力做简单的事情:我只需要将一些单元格设置为上一行中的值。
我尝试过 = A(Row() - 1)但它不起作用。

I am trying to do simple thing: I just need to set some cells to values that are on the previous rows. I have tried =A(Row()-1) but it does not work.

推荐答案

为了在Excel中解决这个问题,通常我只需输入上面单元格的文字行号,例如,如果我输入单元格 A7 ,我会使用公式 = A6 。然后,如果我将该公式复制到其他单元格,那么它们也将使用上一个单元格的行。

To solve this problem in Excel, usually I would just type in the literal row number of the cell above, e.g., if I'm typing in Cell A7, I would use the formula =A6. Then if I copied that formula to other cells, they would also use the row of the previous cell.

另一个选项是使用间接() ,它将文本语句解析为公式。您可以使用以下内容:

Another option is to use Indirect(), which resolves the literal statement inside to be a formula. You could use something like:

=INDIRECT("A" & ROW() - 1)

上述公式将解析为列 A 中单元格的值并且该行小于包含公式的单元格的行。

The above formula will resolve to the value of the cell in column A and the row that is one less than that of the cell which contains the formula.

这篇关于将值从上一行返回到当前行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆