Vince
Vince

Reputation: 557

Get the last value of a the given header name column in Excel

i am triying two get the last value of a column given the header name. In the example i need two get 64.

enter image description here

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

Answers (1)

First of all, I must say all credits of this answer go to 2 authors:

Last non-empty cell in a column

How to return an entire column

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)

enter image description here

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.

enter image description here

Upvotes: 1

Related Questions