Search code examples
google-sheetsexcel-formulagoogle-sheets-formulaformula

How to Sort the Zero to Back in Formula?


I want to set column E by Ascent order but I want rows that contain Zeros to remain right at the bottom. is this possible with the Query function?

enter image description here

Google Sheet Link

Thanks in advance!


Solution

  • Try:

    ={query(B2:E,"where E>=1 order by E",0);query(B2:E,"where E=0",0)}

    enter image description here

    If you need to sort the second query, just add the relevant order by.