Home > other >  Formula to parse rows in google sheets and group them based on a column value
Formula to parse rows in google sheets and group them based on a column value

Time:11-16

I have data like below in google sheets

A   B   C
1   82  54.73
2   20  58.32
4   78  57.84
3   21  58.58
2   20  55.05
3   20  54.55
1   20  49.63
4   21  43.65
2   33  43.65
5   19  45.87

In this column A can have repeated values

I want to list the rows with same column A values together and order by column B and get below output

A   B   C
1   20  49.63
1   82  54.73
2   20  58.32
2   20  55.05
2   33  43.65
3   20  54.55
3   21  58.58
4   21  43.65
4   78  57.84
5   19  45.87

Can this be achieved using google sheets. If so please suggest the formula to achieve same.

CodePudding user response:

Use the SORT function. Like this:

=sort(A1:C10,1,1,2,1)

enter image description here

CodePudding user response:

or try:

=QUERY(A1:C; "where A is not null order by A,B"; )

enter image description here

  • Related