Saturday, October 3, 2015

Google Spreadsheet Query and Vlookup Formula

Question:

Hi, I am new to using google sheets, but am finding them very helpful. I have 1 problem I haven't figured out yet though.
I have a sheet with the following info.

Name      Den      Amount
Bob         Tiger         55.00
Tom         Tiger       75.00
Grant       Bear         100.00
Zack        Bear          80.00
...
...

What I would like to do is get the row that has the MAX value for each Den.
Tom   Tiger     75.00
Grant  Bear     100.00

Thanks.

Solution:

Have a look at the following screenshot:


I have the following formula in cell G1:
=query(A:C,"select B,max(C) where A<>'' group by B label max(C) 'Amount'")

And then, I have put the following formula in cell F1:
=arrayformula(iferror(vlookup(G:G&H:H,{B:B&C:C,A:A},2,false)))


No comments:

Post a Comment