Home > Software design >  How to Stop Array Formula Messing up in Sorting in Google Sheets
How to Stop Array Formula Messing up in Sorting in Google Sheets

Time:11-26

I am exporting the data through Array(Vlookup from different sheet by matching Id's but whenever i sort the data A to Z by using any column. ID's array formula keeps the Id as it is. Due to which data cannot be sorted.

Your help will be much appreciated.

Sheet Link

CodePudding user response:

try in A1:

={"IDs"; QUERY('Data Sheet'!A2:B, "select A where A <> 0 and A is not null order by B asc")}

and B2:

=ARRAYFORMULA(IF(A2:A="",,IFERROR(VLOOKUP(A2:A, 'Data Sheet'!$A$2:$I, {2,3,4,5,6,7,8}, 0))))

...if you want to keep vlookup

asc can be changed to desc

  • Related