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

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

问题描述

我正在尝试做一些简单的事情:我只需要将一些单元格设置为前几行的值.我试过 =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 中解决这个问题,通常我只会输入上面单元格的文字行号,例如,如果我输入的是 Cell 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.

另一种选择是使用 Indirect(),将里面的文字语句解析为公式.你可以使用类似的东西:

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列中单元格的值以及比包含该公式的单元格的值小1的行.

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天全站免登陆