Google Spreadsheets: How to query countries with max population by continent?
Google Spreadsheets: How to query countries with max population by continent? Let's say I have a table with the columns country, continent and population. How can I use the QUERY function in Google Spreadsheets to select, for each continent, only the country with the highest population? In regular SQL I think I'd use HAVING, but this doesn't seem to be an option here. 3 Answers 3 =SORTN(SORT(G:J,4,0),2^99,2,3,0) SORTN usage is beautiful! – Max Makhrov 2 days ago SORTN @Max Thanks. Investing time in this forgotten function paid off:) – I'-'I 2 days ago I suggest a h...