Google Sheets: Filter by Date and Count Text Strings

google sheets

I'm not very experienced with Google Sheets, but I found a function here on Stack Overflow and modified it a bit to do almost everything I need:

=COUNT(FILTER('2014 Form Data'!$A:$A,'2014 Form Data'!$A:$A>=Tables!$A2 , '2014 Form Data'!$A:$A<='Tables'!$B2 ,TRIM('2014 Form Data'!$G:$G)=Tables!$D$2))

Where '2014 Form Data'!$A:$A contains a date and time-stamp, Tables!A2 contains the start of a month and Tables!B2 contains the last day of the month, and Tables!$D$2 contains the value I want to count from among all the time stamped entries for that month in the column 2014 'Form Data'!$G:$G. So basically, I get a result that says something like 5 entries from March had this particular value in this column.

It works great, I love it, but I'd like it to do one more thing…I'd like it to count instances of the text string in Tables!$D$2, even when there is other text present in the cells for '2014 Form Data'!$G:$G.

Any help on this issue will be much appreciated.

Best Answer

So, basically, you are counting the rows where (among other conditions), the G column cell is exactly the text on Tables!D2. And, instead, you want to count where the G column cell contains the text on Tables!D2. Am I right?

You can do that with the following change to your formula. Replace:

TRIM('2014 Form Data'!$G:$G)=Tables!$D$2

With:

ISNUMBER(FIND(Tables!$D$2;'2014 Form Data'!$G:$G))