1

In Google Sheets, I have a table that looks like this:

 A      B    
ID1  data 123
ID2  data 234
ID1  data 456
ID2  data 567

I want to get data 567 for ID2. Using Match(...,0) or VLOOKUP(...,FALSE), I get the first value for ID2 - but I want the last.

This answer uses =LOOKUP(2,1/(A1:A4=D1),B1:B4), but I saw that the 1/(A1:A4=D1) notation only works in Excel, not Google sheets.

This link suggests using MATCH(...,1), but that only works for sorted keys, which I don't have!

This VBA solution will probably not work in Google Sheets either...

I can add additional hidden columns (may an IsLast column?), it that would help.

4

2 回答 2

2

在谷歌文档中试试这个formua

=arrayformula(index(B:B,max(if(A1:A4=D1,row(A1:A4)))))

于 2014-08-08T17:42:12.053 回答
0

我在谷歌表格中完成了这个:=VLOOKUP(max(A:A),B:B,1)

于 2014-08-08T16:58:41.280 回答