I've few sheets where rows are populated dynamically via IMPORTXML and ImportJSON with the same columns, but they can't be sorted.

So I'd like to generate new sheet which will populate rows from other sheets, so consolidated rows can be sortable. Copying won't help when feed will change as main sheet won't be up-to-date.


I'd like to consolidate these 3 YouTube Data feeds from different countries:

=ImportJSON("http://gdata.youtube.com/feeds/api/standardfeeds/GB/most_popular?v=2&alt=json", "/feed/entry/title,/feed/entry/content/src", "noInherit,noTruncate,rawHeaders")
=ImportJSON("http://gdata.youtube.com/feeds/api/standardfeeds/US/most_popular?v=2&alt=json", "/feed/entry/title,/feed/entry/content/src", "noInherit,noTruncate,rawHeaders")
=ImportJSON("http://gdata.youtube.com/feeds/api/standardfeeds/AT/most_popular?v=2&alt=json", "/feed/entry/title,/feed/entry/content/src", "noInherit,noTruncate,rawHeaders")

into one sheet and sort them by title.


1 Answer 1


Short Answer

Use arrays in Google Sheets and SORT() function.


To combine the non continuous ranges A1:D5, H1:K100, P1:S15, the following formula will return a 4 X 120 array sorted by the first column in ascending order.


The first parameter also could be any function that returns an array like IMPORTFEED.


  • The URLs provided in example are not working because the YouTube Data API (v2) has been officially deprecated as of March 4, 2014.
  • IMPORTJSON() was retired of the new Google Sheets.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.