Sort data based on checkbox

Viewed 45

I have three columns with multiple rows: The first column (A)is numbered (1,2,3,4) the second column(B) is lettered (A,B,C,D), and the third is corresponding info (C).

I want to be able to select a boolean that toggles the sorting of the sheet between sorting in descending order by the numbers (Column A) and sorting by the letters (Column B)

Thank you!

An image for clarification

1 Answers

Try:

=IF(D1,SORT(A4:C,1,false),ARRAYFORMULA(A4:C))

Result:enter image description here

Using IF() to check if checkbox is true, then SORT() the Columns A,B,C by descending order based on column A.

Related