Using multiple filter functions in google sheets elastically -


in google spreadsheet, have summary sheet importing information multiple sheets. 1 of filter function looks following:

=filter(sheet2!a14:a27, (sheet2!k14:k27="y") + (sheet2!k14:k27="r"))

i have multiple filter functions one. problem facing have assign static number of rows result of function result dynamic (could 1 row or 15 rows).

i have been searching exhaustively couldnt find way elastically results of filter functions appended (with perhaps empty row/header row between each of results).

one solution gave on 1 of forums assign static number of rows each , hide empty rows using script did not seem clean solution (but may have fallback on that)

also, thought of using scripts if understand correctly, scripts can 'triggered' menus, onopen, onedit etc. may not intuitive (one has reload spreadsheet see change in case of onopen(), etc.)

using custom functions again cause same problem because custom functions run on specific cell (and dont know cell since trying make dynamic)

happy hear thoughts!

you should pass cells/ranges work on custom function instead of reading them within function. try not write directly instead return result. way spreadsheet automatically update correctly , won't need permissions. here example

function myfilter(values1, values2) {   return values1.filter(function(v, i) {     return values2[i][0] === "y" || values2[i][0] === "r";   }); } 

and do

={myfilter(sheet1!a14:a27,sheet1!k14:k27);a1;myfilter(sheet2!a14:a27,sheet2!k14:k27)} 

still get's little long though. save intermediary results in different cells , join results together. or write filter function can take arbitrary number of ranges arguments. can give more examples of filter functions like. maybe there better way modularise/shorten it.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -