+ Reply to Thread
Results 1 to 5 of 5

Count number of cells that contain text but exclude cells that contain quotation marks

  1. #1
    Registered User
    Join Date
    06-22-2012
    Location
    Vancouver Canada
    MS-Off Ver
    Excel 2003
    Posts
    3

    Count number of cells that contain text but exclude cells that contain quotation marks

    Hi,

    I have a workbook that we use to log vessel information and loading information. In the first column A we enter the vessel name,then along the row we enter the other required info. If a vessel has multiple loadings, we enter " (quotation marks) to indicate the information is the same as the cell above. We want to be able to have a count of the total number of vessels loaded and I figured the easiest way would be to count the number of cells with text in them, to this end I used the formula;

    =COUNTA(A7:A36)

    The problem with this is it also counts the cells with quotation marks, which we do not want to do as it a second, third etc loading of the vessel, we only want to count the original name of the vessel. to this end I tried;

    =COUNTIF(A7:A36,"<>~""")

    for some reason this gave me a count of 30 no matter what I entered, deleted, cleared content of cell etc. Is there a formula I can use to only count text excluding quotation marks, or all punctuation marks if that is simpler. Or, what about just counting cells that contain Alphabetic characters (A to Z both capitals and small letters). I have attached a example of our workbook for clarification which has the formula =COUNTIF(A7:A36,"<>~""")
    in use but not working in cell A37Prince Rupert Visual ID and Berlese Vessel Infestation Checks test.xls

    I truly appreciate any and all help anyone can give me before I pull all my hair out..what little I have left....LOL

    Many Many Thanks

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Count number of cells that contain text but exclude cells that contain quotation marks

    Maybe: =COUNTA(A7:A36)-COUNTIF(A7:A36,"""")

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

    Re: Count number of cells that contain text but exclude cells that contain quotation marks

    Try:

    =SUMPRODUCT(--(A7:A36<>""),--(A7:A36<>""""))
    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
    Registered User
    Join Date
    06-22-2012
    Location
    Vancouver Canada
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Count number of cells that contain text but exclude cells that contain quotation marks

    Quote Originally Posted by zbor View Post
    Maybe: =COUNTA(A7:A36)-COUNTIF(A7:A36,"""")
    Awesome that worked perfectly! I really appreciate the help!

  5. #5
    Registered User
    Join Date
    06-22-2012
    Location
    Vancouver Canada
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Count number of cells that contain text but exclude cells that contain quotation marks

    Thank you too NBVC for your help, its great to find such knowledge in one place.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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