You can build a parameter table in Google Sheets that allows the user to choose criteria, columns in order and a sort order with the QUERY function. The criteria can match text, logical values, look for entries after a start date or above a number or check if it contains certain text. Plus impressively you can choose which columns you want to be returned and the order in which you want them returned, as well as which column you want things sorted by.
=QUERY(data,query). First enter the data, then for the query start with "Select (specify columns) where (specify parameters) order by (specify col then asc or desc)
To download example files, enter email here: https://www.xlconsulting-asia.com/socials.html
For parameters:
TEXT must be wrapped in single quotations (use =or contains),
For TRUE/FALSE or numbers, no quotations needed and you can be use operators
Dates must be converted to yyyy-mm-dd using =TEXT(cell,"yyyy-mm-dd") and prefix it with date, and wrap with single quotations
We go through QUERY, TEXT, TEXTJOIN, TRANSPOSE, and IF here, mostly focusing on QUERY.
My video on the full guide to the QUERY is here:
https://youtu.be/4pdwoLGhzJ4
00:00 - Introduction
02:05 - The QUERY function
04:54 - Text parameters
07:38 - Numerical criteria
08:44 - Date criteria
10:23 - Checkboxes or TRUE/FALSE
10:59 - Contains
11:25 - TEXTJOIN: Combine multiple parameters
12:32 - Column choices & order
13:53 - Sort order