+ Reply to Thread
Results 1 to 7 of 7

count cells that contain text but do not count cells containing only a formula

  1. #1
    Registered User
    Join Date
    03-12-2013
    Location
    Caledon, Canada
    MS-Off Ver
    Excel 2003
    Posts
    20

    count cells that contain text but do not count cells containing only a formula

    Hi, I am using the following formula (which I learned on this site yesterday - big thanks) to copy text:

    =IF('Registration '!G63="Parent",'Registration '!B63,"")

    Now I want to be able to count the cells containing text in the worksheet that I have copied to (i.e. cells containing parent's last names). How do I count cells with text only, not cells containing the formula? Thanks.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: count cells that contain text but do not count cells containing only a formula

    that formula will leave an "empty" cell if there is no "Parent", so you should be able to use =countA()
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    03-12-2013
    Location
    Caledon, Canada
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: count cells that contain text but do not count cells containing only a formula

    On the worksheet that the names are copied to, =countA is counting the cells that contain the formula (in other words, all of the cells).

    Is there a way of counting cells that contain text (parent's names) but not counting cells that contain numbers (formula)?

  4. #4
    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 but do not count cells containing only a formula

    A formula blank is considered a TEXT entry.

    This will count all cells that contain a text entry but will exclude cells that contain formula blanks:

    =COUNTIF(A1:A10,"?*")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: count cells that contain text but do not count cells containing only a formula

    hmm my brain has gone blank. For the time being, use this...until I can think of a better way...

    =COUNTA(A1:A9)-COUNTBLANK(A1:A9)

  6. #6
    Registered User
    Join Date
    03-12-2013
    Location
    Caledon, Canada
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: count cells that contain text but do not count cells containing only a formula

    That works. Thanks.

  7. #7
    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 but do not count cells containing only a formula

    You're welcome. 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)

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