Google App Script / Spreadsheet - How to get filter criteria?

后端 未结 6 532
自闭症患者
自闭症患者 2020-12-10 18:18

Is it possible to get the filter criteria of my data set. For example, if one of my column is \"Department\" and I filtered the data to display only \"IT\". How do we get th

6条回答
  •  我在风中等你
    2020-12-10 18:53

    Google Spreadsheet already has a FILTER formula (I always use this page to remind me how to do it). So for example if your data looked like this

      A
    1 Department
    2 IT Department (Edinburgh)
    3 Department of IT
    4 Other Department
    

    to get a filtered list you could use the formula

    =FILTER(A:A;FIND("IT",A:A)>0)
    

    (Working example here)

    If you want to do something entirely in Apps Script Romain Vialard has written a Managed Library with a filter function. Here are instructions for installing and using the 2D Array2 library

提交回复
热议问题