I have data that I want to sort in my google sheets; but I want to show only specific columns and not others.
Here's an example :
Name | Type | HP | ATK |
---|---|---|---|
Hero1 | type1 | 10 | 5 |
Hero2 | type1 | 9 | 8 |
Hero3 | type2 | 11 | 7 |
After a =SORT()
in an other sheet; I'd like to have something like this :
Name | HP |
---|---|
Hero3 | 11 |
Hero1 | 10 |
Hero2 | 9 |
And with an other =SORT()
have this :
Name | ATK |
---|---|
Hero2 | 8 |
Hero3 | 7 |
Hero1 | 5 |
I tried with FILTER()
But I can't manage to get rid of the Type
column
Of course I don't want to modify the first table
But I could use sorted tables containing only the name and not wathever value was used to sort them
CodePudding user response:
You can create a virtual array {A2:A,D2:D}
and use
=SORT({A2:A,D2:D},2,0)
or even
=SORT({A2:A,C2:C},2,0)
CodePudding user response:
One
=QUERY({A2:D},"Select Col1,Col4 Order by Col4 desc",1)
Two
=QUERY({A2:D},"Select Col1,Col3 Order by Col3 desc",1)