Luis Miguel Delgado
Luis Miguel Delgado

Reputation: 103

Get the last value of a column when another has a specific value

In this great community I always like to learn with what I am discovering, that is why I would like to know if this solution that I have found can be done in a better way.

I have two columns where I am introducing values and I get a value from a column according to the condition of the first one.

I do this with the following google sheets formula:

=INDEX(filter(Blockchains!F$2:F,Blockchains!E$2:E=VALUEA),ROWS(filter(Blockchains!F$2:F,Blockchains!E$2:E=VALUEA)),1)

Is there a way to make it better?

Upvotes: 0

Views: 443

Answers (1)

player0
player0

Reputation: 1

try:

=INDEX(QUERY(SORT(E:F, ROW(E:E), ), "where Col2 = 'VALUEA'", ), 1, 1)

enter image description here

better safe than sorry:

=INDEX(QUERY(SORT(E:F, ROW(E:E), )&"", "where Col2 = 'VALUEA'", ), 1, 1)

enter image description here

Upvotes: 1

Related Questions