Google Docs formula auto copy and display cell if

2019-06-14 09:01发布

问题:

I have a Google Docs spreadsheet, where I store rss feeds (in Sheet1). What I would like to do is to create formula, which will, in Sheet2, copy and display all feeds from Sheet1, which contains certain words. To be more clear, I prepared a screen shot of an example. In this example I would like to copy and display (from Sheet1 to Sheet2) all feeds with the words BLACK and SHIRT, and from here on I would like to auto copy and display feed, every time it will contain this two words. Is this possible and how? Thank you for your help!

回答1:

To return rows that contain the string 'black shirt':

=QUERY(Sheet1!B:B;"select * where B contains 'black shirt'";1)

To return rows that contain any complete words listed in C2:C:

=FILTER(Sheet1!B2:B;MMULT(SEARCH(TRANSPOSE(" "&C2:C&" ");" "&Sheet1!B2:B&" ");SIGN(ROW(Sheet1!B2:B))))

QUERY documentation

FILTER documentation

Example spreadsheet