Consulting

Results 1 to 5 of 5

Thread: Solved: countif contains multiple text values

  1. #1

    Solved: countif contains multiple text values

    Need to know if there is a formula for counting text in Excel that would count the cell if if contains multiple values.

    for example:

    I am wanting Excel to count the range of cells in column J that contain the word football. However, some of the cells contain football, baseball.
    and other will have baseball, football.

    Is there anyway that I can write the formula that would count the cells if the word is showing at all?

    Thanks in advance for any and all help.

  2. #2
    Football ??? don't you call that Soccer ?
    This is a tricky one which lends itself to a UDF but here's an array that does the job by cheating
    =SUM(IF(LEN(J2:J100)<>LEN(SUBSTITUTE(J2:J100,"football","")),1,0))
    remember commit this formula with ctrl-shft-enter
    2+2=9 ... (My Arithmetic Is Mental)

  3. #3
    Thank you very much. That works perfectly

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Another, non-array formula

    =SUMPRODUCT(--(ISNUMBER(SEARCH("football",J2:J100))))
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Another non-array formula :-
    =countif(J2:J100,"*football*")
    2+2=9 ... (My Arithmetic Is Mental)

Posting Permissions

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