How can I reference a cell in the same column in the previous visible row from a filtered range?
Asked
Active
Viewed 6,567 times
1 Answers
8
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:
- retrieve the value in column E
- subtract 1 from it
- 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

Gary's Student
- 95,722
- 10
- 59
- 99
-
I tried to use Index/Match, but without a success, how can I find the coordinates of the above cell? For example, in your last image, imagine that c5 needs a reference to its above cell, in this case c2 – Riko Mar 12 '15 at 20:16