问题
Consider the following table :
Test Name Bug name Status
Name1 Bug1 Fail
Name2 Bug1 Fail
Name3 Bug2 Fail
Name4 Bug3 Fail
Name5 Bug4 Fail
Name6 Bug3 Fail
I want to be able, on a given Google spreadsheet to select all rows containing distinct 'Bug name' columns, so the result should be the following :
Test Name Bug name Status
Name1 Bug1 Fail
Name3 Bug2 Fail
Name4 Bug3 Fail
Name5 Bug4 Fail
回答1:
Assuming you have the example table in range A1:C, I think the expected result could be achieved with this formula:
=ArrayFormula(iferror(vlookup(unique(B1:B),{B1:B,A1:C}, {2,3,4}, 0 )))
See if that helps ?
来源:https://stackoverflow.com/questions/30318460/selecting-all-rows-with-distinct-column-values-google-query-language