This is the third part of a question that started with trying to filter a spreadsheet using a formula:
Here I realized that what I wanted to do could not be done using the spreadsheet formulas, so I decided to try it using scripts.
To perform this filtering with scripts, I tried to use an external library called 2D Arrays Library , with which I was able to filter the data, but not in the way I wanted.
My intention is to filter the data of a 2D Array in which I can use 2 exact criteria, since with the library I have only managed to filter the cells that contain these criteria.
For this, I leave at your disposal a test spreadsheet that contains a list with the data to be filtered, a sheet with the current filter and another sheet with the expected result, in addition to containing the script and the library that I am using.
The following shows how to use the method
filter
toArray
filter by exact match of two conditions, it is assumed that the area corresponding to the filtered data was previously emptied.Related
I leave the completesolution of the script:The only thing I would like to modify is the method to delete the rows, since the one I use also deletes the formatting of the cells.