+ Reply to Thread
Results 1 to 3 of 3

Counting words in cells with multiple conditions

Hybrid View

  1. #1
    Registered User
    Join Date
    12-09-2011
    Location
    CO
    MS-Off Ver
    Excel 2007
    Posts
    2

    Counting words in cells with multiple conditions

    PLEASE HELP!

    I have four columns of diagnoses per client, and I want to count how many have a substance abuse/dependence diagnosis, without double counting those with more than one substance diagnosis. The below example row has two substance diagnoses (cannabis and alcohol), but I only want to count it once. I have tried to use the below formula, but it just returns all 1's. Is something wrong with this formula, or do I need a completely different approach.

    Example row: H3: Depressive Disorder NOS ADHD (Combined Type), I3: Cannabis Dependence, J3: Alcohol Abuse, I3: Oppositional Defiance Disorder


    =IF(AND(OR(H3="*Cannabis*",H3="*Alcohol*",H3="*Substance*",H3="*Opioid*",H3="*Amphetamine*",I3="*Cannabis*",I3="*Alcohol*",I3="*substance*",I3="*Opioid*",I3="*Amphetamine*",J3="*Cannabis*",J3="*Alcohol*",J3="*Substance*",J3="*Opioid*",J3="*Amphetamine*",K3="*Cannabis*",K3="*Alcohol*",K3="*Substance*",K3="*Opioid*",K3="*Amphetamine*")),1,0)

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,709

    Re: Counting words in cells with multiple conditions

    Try this formula

    =IF(SUM(COUNTIF(H3:K3,"*"&{"Cannabis","Alcohol","Substance","Opioid","Amphetamine"}&"*")),1,0)
    Audere est facere

  3. #3
    Registered User
    Join Date
    12-09-2011
    Location
    CO
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Counting words in cells with multiple conditions

    It works!! Thank you!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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