Why doesn't LIKE's percentage % match new lines with this query?

Viewed 25

Any ideas why LIKE doesn't find a word in multiple lines cell if we are trying to pivot results

Example below:

[We have a table, where 1st line has 2 lines in cell]1

if i do query and try to pivot results the line which has 2 lines is ignoring as a result and not posted in pivot table Formula as follows

=QUERY(B:G;"SELECT D, E, SUM(F), AVG(F) WHERE B IS NOT NULL AND B LIKE '%"&H1&"%' GROUP BY D,E pivot C")

[Result]2

https://docs.google.com/spreadsheets/d/19IjdsKJK_sXCn-Syv3Lh4wfR5jmCy2Vp6YqHzVspUCw/edit?usp=sharing

1 Answers

use:

=QUERY(B:G; 
 "select D,E,sum(F),avg(F) 
  where B is not null 
    and B contains '"&H1&"' 
  group by D,E 
  pivot C")

enter image description here

Related