My data in the range 'known' includes a column with the beginning year (E) and another with final year (F). I want to build a query to find the 10 entries that lasted longest. I started with
=QUERY(known,"SELECT A, B, F-E label F-E 'TopTen' " ,1)
which works fine but I can't find a way of ordering F-E and limiting the results. ORDER BY and LIMIT don't seem to work. I want to avoid creating a new calculated field in the data itself. Grateful for any suggestions.
0
votes
=QUERY(A:F,"SELECT A, B, F-E order by F-E desc limit 10 label F-E 'TopTen'" ,1) works for me
– Tom Sharpe