+ Reply to Thread
Results 1 to 4 of 4

how to use the COUNTIFS function to assess word multi criteria search in textual data

  1. #1
    Registered User
    Join Date
    09-29-2015
    Location
    Los Angeles
    MS-Off Ver
    2011
    Posts
    2

    how to use the COUNTIFS function to assess word multi criteria search in textual data

    I am sifting through a dataset that has comments in a single column. I would like to identify the number of cells that contain at least one occurrence of word1 and word2. The command should tell me the number of cells that contain both words regardless of the order or placement of the words within the cell.

    when i try to use the =COUNTIFS(columnrow1:columnrow2, "*word1*", columnrow1:columnrow2, "*word2*") I receive a number that indicates all cells containing word1 followed by word2 (other words can be between them). however, this does not indicate cells that contain word2 before word1.

    I then try to use the command =COUNTIFS(columnrow1:columnrow2, "*word1*", columnrow1:columnrow2, "*word2*") + COUNTIFS(columnrow1:columnrow2, "*word2*", columnrow1:columnrow2, "*word1*").
    This formula returns cells that contain both word1 and word2 in either order, however there is some double counting of cells that contain the word1 followed by word2 followed by word1 (or other similar combinations.)

    Please tell me the command that allows me to search a single column for cells containing word1 AND word2

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: how to use the COUNTIFS function to assess word multi criteria search in textual data

    Can you post a SMALL sample file and show us what result you expect?

    A SMALL file will have about 20 rows worth of data.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    09-29-2015
    Location
    Los Angeles
    MS-Off Ver
    2011
    Posts
    2

    Re: how to use the COUNTIFS function to assess word multi criteria search in textual data

    Thank you for your timely response. I have been fiddling with the data and it appears that the =COUNTIFS(A2:A11, "*word1*", A2:A11, "*word2*") is counting all cells that contain both word1 and word2, regardless of the order in which they appear.

    I think I have solved this problem for now. If I have further questions I will repost.

    Thank you again

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: how to use the COUNTIFS function to assess word multi criteria search in textual data

    Good deal. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Need a function(s) to search data with two criteria.
    By ethomp in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-24-2013, 05:58 PM
  2. Multi criteria search result to give unique answer
    By redpis in forum Excel General
    Replies: 2
    Last Post: 08-13-2013, 04:05 PM
  3. [SOLVED] Match search terms, and add data in next column. Multi search problem.
    By Wales MB in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-23-2013, 06:10 PM
  4. [SOLVED] How to limit multi-value (OR) FIND or SEARCH to the first or last word in a string?
    By Buzzed Aldrin in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-16-2012, 04:05 PM
  5. Userform Multi Criteria search
    By winkypinky in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2012, 04:41 PM
  6. [SOLVED] multi-criteria search lookup fail
    By zfl in forum Excel General
    Replies: 4
    Last Post: 06-16-2012, 09:26 AM
  7. Replies: 6
    Last Post: 02-21-2009, 08:13 PM
  8. VBA sum on multi search criteria - how?
    By adventurous in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-16-2005, 07:46 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1