+ Reply to Thread
Results 1 to 5 of 5

Count cells that contain text

  1. #1
    Registered User
    Join Date
    04-21-2012
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    1

    Count cells that contain text

    I would like to count all the values in column A that match the ">10" in cell B1. I don't want to count all the values less than 10. Rather, I want to count the number of cells that match the exact text ">10". How would I write this formula?

    Thanks for your help.

    Jeff

  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: Count cells that contain text

    If I understand what you want to do...

    =SUMPRODUCT(--(A1:A10=B1))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Count cells that contain text

    Or

    =COUNTIF(A1:A10,"="&B1)

  4. #4
    Valued Forum Contributor mahju's Avatar
    Join Date
    11-27-2010
    Location
    Pakistan, Faisalabad
    MS-Off Ver
    Excel 2010 plus
    Posts
    730

    Re: Count cells that contain text

    Also try to match the text and not compare values

    =COUNTIF(A1:A10,"*>10" )

    It will count the number of cells containing ">10" so there should be no value containing ">10" e.g. "aa>10", ">10ss55" or "dd>10pp"

    Regards
    Last edited by mahju; 08-17-2016 at 12:11 PM.
    Mark the thread as solved if you are satisfied with the answer.


    In your first post under the thread tools.

    Mahju

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Count cells that contain text

    Quote Originally Posted by mahju View Post
    Also try to match the text and not compare values
    That is what Tony and myself have already done, without the possibility of incorrect results if the criteria matches part of a longer text string.

    Sumproduct will evaluate ">10" as a text string, not as values greater than 10.

    Using countif, "="&B1 gives a criteria string of "=>10" which looks for values equal to ">10" not values that are greater than or equal to 10. The function can be tricked by using < = and > in less conventional ways.

+ 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. Count Cells with Text that are Adjacent to Cells with Text
    By mbjcc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-04-2015, 12:41 PM
  2. [SOLVED] Count cells containing text - different cell text - one sum
    By oliver1712 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-10-2014, 08:02 PM
  3. Replies: 3
    Last Post: 05-13-2014, 10:48 PM
  4. [SOLVED] Formula needed to only count total cells entered and not count adjacent text entered cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-07-2013, 06:22 PM
  5. [SOLVED] count cells that contain text but do not count cells containing only a formula
    By cprpacific in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-13-2013, 03:15 PM
  6. [SOLVED] Count number of cells that contain text but exclude cells that contain quotation marks
    By Cantyman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-22-2012, 03:57 PM
  7. Replies: 2
    Last Post: 05-09-2012, 11:22 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