EXCEL引用上一个可见行中的单元格

时间:2022-10-09 22:24:06

How can I reference a cell in the same column in the previous visible row from a filtered range?

如何从过滤范围中引用上一个可见行中同一列中的单元格?

1 个解决方案

#1


4  

This is very easy if we prepare to do it.

如果我们准备这样做,这很容易。

Say we have data like:

假设我们有以下数据:

EXCEL引用上一个可见行中的单元格

The first step is to introduce a "helper" column. In E2 we enter:

第一步是引入“帮助”列。在E2中我们输入:

=IF(SUBTOTAL(3,A2:A2)=0,MIN($E$1:E1)-1,SUBTOTAL(3,$A$2:$A2))

and copy down:

并复制下来:

EXCEL引用上一个可见行中的单元格

Now the cool thing about the "helper" column is that no matter how you filter it, it always shows a simple sequential sequence....let's filter for Alice

现在关于“助手”专栏的一个很酷的事情是无论你如何过滤它,它总是显示一个简单的顺序序列....让我们过滤爱丽丝

EXCEL引用上一个可见行中的单元格

This means that any cell can:

这意味着任何细胞都可以:

  1. retrieve the value in column E
  2. 检索E列中的值
  3. subtract 1 from it
  4. 从中减去1
  5. use this value in a Index()/Match() formula to retrieve any value in the previous visible row
  6. 在Index()/ Match()公式中使用此值可以检索上一个可见行中的任何值

EDIT#1:

编辑#1:

To answer your question, in C5 we enter:

要回答您的问题,请在C5中输入:

=INDEX($C$2:$C$21,MATCH(E5-1,$E$2:$E$21,0))

and with no filtering C5 will display $391.00
But with Alice filtering C5 will display $446.00

并且没有过滤C5将显示$ 391.00但是使用Alice过滤C5将显示$ 446.00

#1


4  

This is very easy if we prepare to do it.

如果我们准备这样做,这很容易。

Say we have data like:

假设我们有以下数据:

EXCEL引用上一个可见行中的单元格

The first step is to introduce a "helper" column. In E2 we enter:

第一步是引入“帮助”列。在E2中我们输入:

=IF(SUBTOTAL(3,A2:A2)=0,MIN($E$1:E1)-1,SUBTOTAL(3,$A$2:$A2))

and copy down:

并复制下来:

EXCEL引用上一个可见行中的单元格

Now the cool thing about the "helper" column is that no matter how you filter it, it always shows a simple sequential sequence....let's filter for Alice

现在关于“助手”专栏的一个很酷的事情是无论你如何过滤它,它总是显示一个简单的顺序序列....让我们过滤爱丽丝

EXCEL引用上一个可见行中的单元格

This means that any cell can:

这意味着任何细胞都可以:

  1. retrieve the value in column E
  2. 检索E列中的值
  3. subtract 1 from it
  4. 从中减去1
  5. use this value in a Index()/Match() formula to retrieve any value in the previous visible row
  6. 在Index()/ Match()公式中使用此值可以检索上一个可见行中的任何值

EDIT#1:

编辑#1:

To answer your question, in C5 we enter:

要回答您的问题,请在C5中输入:

=INDEX($C$2:$C$21,MATCH(E5-1,$E$2:$E$21,0))

and with no filtering C5 will display $391.00
But with Alice filtering C5 will display $446.00

并且没有过滤C5将显示$ 391.00但是使用Alice过滤C5将显示$ 446.00