+ Reply to Thread
Results 1 to 6 of 6

Sum of Countifs: a simple question, I'm sure

Hybrid View

  1. #1
    Registered User
    Join Date
    09-30-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    81

    Sum of Countifs: a simple question, I'm sure

    I am trying to count the number of times a string appears in a column. Cells in that column have that string, and occasionally other data as well. I'm not sure why this isn't working for me:

    =SUM(COUNTIF(Sheet2!G:G,{"Things"}))
    This next formula is working for me, but only counts the string if it is the only thing in the cell.

    =COUNTIF(Sheet2!G:G,"Things")
    What formula should I use when I want to count a string whether it is the only thing in the cell or not? Thank you for any help you can offer, in advance.
    Last edited by Nate Westcott; 01-29-2014 at 01:31 PM.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Sum of Countifs: a simple question, I'm sure

    Try

    =COUNTIF(Sheet2!G:G,"*Things*")

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,423

    Re: Sum of Countifs: a simple question, I'm sure

    If you use:

    =COUNTIF(Sheet2!G:G,"Things")

    then the count will only reflect exact matches. However, you can use the wildcard characters with COUNTIF, so you could have this instead:

    =COUNTIF(Sheet2!G:G,"*Thing*")

    and this would include in the count those cells which have "nothing", "some thing", "things", "farthing" and so on. You can leave one of the asterisks out if you just want to count cells that begin with that word, or those cells which end with that word.

    Hope this helps.

    Pete

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,655

    Re: Sum of Countifs: a simple question, I'm sure

    Some ways of using COUNTIF:
    =COUNTIF(A:A,"Adam") counts cells with only Adam in
    =COUNTIF(A:A,"Adam*") counts cells with Adam1,Adam2,...
    =COUNTIF(A:A,"*Adam*") counts cells with xAdam1,yAdam2,...
    =COUNTIF(A:A,{"Adam","Eva"}) establishes array with either Adam or Eva, then SUM(COUNTIF(A:A,{"Adam","Eva"})) (Aray formula) counts cells with either Adam or Eva

    I am not sure these match your issue or not?
    Quang PT

  5. #5
    Registered User
    Join Date
    09-30-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Sum of Countifs: a simple question, I'm sure

    Thank you, all. This fixed my problem. I had forgotten that you need two asterixes, not just one.

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Sum of Countifs: a simple question, I'm sure

    Glad to help, 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. COUNTIFS Question
    By rdp33 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-28-2013, 07:27 PM
  2. [SOLVED] CountIFs question
    By Ryuujin in forum Excel General
    Replies: 4
    Last Post: 06-12-2012, 07:33 AM
  3. Replies: 0
    Last Post: 12-16-2011, 09:01 AM
  4. A simple question requiring a simple answer
    By Pedros in forum Excel General
    Replies: 3
    Last Post: 07-18-2006, 06:45 AM
  5. Simple Simple Excel usage question
    By BookerW in forum Excel General
    Replies: 1
    Last Post: 06-23-2005, 05:05 PM

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