Sort pie chart segments without sorting data in columns

I have not found anything like this on the Internet, and it seems that the only way to sort data in a pie chart is to pre-sort. The problem is that I have a sheet filled with third-party software (Typeform) that contains random data, which I then collect for presentation in a pie chart.

In particular, Typeform writes

 town   | salary | cost
London  | 1000   | 500
Bristol | 700    | 300
London  | 900    | 400
Leeds   | 600    | 200
Leeds   | 500    | 300
Leeds   | 400    | 200

Then I merge the data on another sheet (Sheet2) so that I have

town   |  occurrences
London      2
Bristol     1
Leeds       3

Obviously, a pie chart will draw first London, then Bristol, and then Leeds. These are only 3 entries, but in my example there are 20 entries and the data in the pie chart is not ordered.

Sheet2 , =UNIQUE(Sheet1!A2:A), =countif(Sheet1!A:A,A2), Sheet1, , , , , , .

( ) Sheet2 ?

+6
3

town A1 Sheet1, :

=query(Sheet1!A2:D7, "select A, count(C) group by A")  

SO33597438 first example

SO33597438 second example

0

- , A-Z ( ) Z-A ( ).

PIE , !

0

Assuming Typeform data is in Sheet1! A: C, the next function in Sheet2! A1 should do the trick:

= QUERY ("Sheet1! A: C", "select A, count (B) order by count (B) desc", 1)
0
source

Source: https://habr.com/ru/post/1614958/


All Articles