I wish to count occurrences of a word in one of two columns in a worksheet, within a date range. So I have:
=SUMPRODUCT(ISNUMBER(SEARCH("heparin",DATA!$J$2:$K$25))*((DATA!$B$2:$B$25>VALUE("12/31/2007"))*(DATA!$B$2:$B$25<=VALUE("3/31/2008"))))
Problem is I'm getting a double count of records where the search term is in both columns, i.e. I'm getting 12 as an answer instead of 10 because two items satisfy the ISNUMBER(SEARCH) function twice, once in each column.
Is there a way to "OR" this? I tried using each column separately, with a "+" sign, but it didn't work or I didn't write it correctly. Thanks!
=SUMPRODUCT(ISNUMBER(SEARCH("heparin",DATA!$J$2:$K$25))*((DATA!$B$2:$B$25>VALUE("12/31/2007"))*(DATA!$B$2:$B$25<=VALUE("3/31/2008"))))
Problem is I'm getting a double count of records where the search term is in both columns, i.e. I'm getting 12 as an answer instead of 10 because two items satisfy the ISNUMBER(SEARCH) function twice, once in each column.
Is there a way to "OR" this? I tried using each column separately, with a "+" sign, but it didn't work or I didn't write it correctly. Thanks!