Reputation: 557
i am triying two get the last value of a column given the header name. In the example i need two get 64.
My attempy is not working
INDEX($A$3:D7,MATCH(A3,$A$3:D7;);COUNTA(MATCH($F$3,$A$2:$D$2,)))
Upvotes: 1
Views: 100
Reputation: 11978
First of all, I must say all credits of this answer go to 2 authors:
I just combined these 2 formulas into this:
=INDEX(INDEX(B3:D7;0;MATCH(G2;B2:D2;0));MAX((INDEX(B3:D7;0;MATCH(G2;B2:D2;0))<>"")*(ROW(INDEX(B3:D7;0;MATCH(G2;B2:D2;0)))))-2)
Notice at the end I added -2
and this is critical. It's because your data starts at row 3. If headers were on row 5, and data started at row 6, then it would be -5
and so on.
And this is how it works in live action. It gets the value of the last non empty cell in column.
Upvotes: 1