EXCEL Reference a cell in the previous visible row

一笑奈何 提交于 2019-12-04 07:34:03

This is very easy if we prepare to do it.

Say we have data like:

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

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

and copy down:

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

This means that any cell can:

  1. retrieve the value in column E
  2. subtract 1 from it
  3. use this value in a Index()/Match() formula to retrieve any value in the previous visible row

EDIT#1:

To answer your question, in C5 we enter:

=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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!