+ Reply to Thread
Results 1 to 4 of 4

Countif cell contains this text string, cell does not have to equal this value exactly.

  1. #1
    Forum Contributor
    Join Date
    08-22-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2003
    Posts
    129

    Countif cell contains this text string, cell does not have to equal this value exactly.

    Hi.

    I want to use a countif on a spreadsheet but some of the cells are "2 & 7" for example and I want this to count +1 for the total 2's and total 7's, with a typical countif it obviously counts it as neither.

    To make life easier, there are no double digits, so there is no need to worry about "17" counting as 1 and 7 etc with your possible methods.

    Any idea how you'd do that?

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

    Re: Countif cell contains this text string, cell does not have to equal this value exactly

    You can use wildcard characters with COUNTIF, so you can do it like this:

    =COUNTIF(range,"*2*")

    Hope this helps.

    Pete

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Countif cell contains this text string, cell does not have to equal this value exactly

    If the column is preformatted as text, then possibly:

    =COUNTIF(A:A,"*2*")

    otherwise try:

    =SUM(COUNTIF(A:A,{2,"*2*"}))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Contributor
    Join Date
    08-22-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2003
    Posts
    129

    Re: Countif cell contains this text string, cell does not have to equal this value exactly

    Please Login or Register  to view this content.
    Worked great. Thanks a lot, both of 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