+ Reply to Thread
Results 1 to 7 of 7

Help with CountA

  1. #1
    Registered User
    Join Date
    01-12-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    97

    Help with CountA

    I have a column of cells that are being imported from another worksheet. Showing in the cells I want to count are

    -

    and

    ***********

    I want to count how many *********** there are in the column but I can't seem to get it to work. Is it because the cell isn't actually *********** but is a formula (from the other worksheet) instead?

    Any help would be appreciated. Thanks.
    Last edited by kufta4; 03-18-2013 at 10:42 AM.

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

    Re: Help with CountA

    Click on a cell containing those ***************** and look in the formula bar to see what it actually contains.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    01-12-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    97

    Re: Help with CountA

    That is what it actually contains. Its a bunch of asterisks. 11 to be exact. I want to count how many cells contain the asterisks as opposed to the "-".

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

    Re: Help with CountA

    The asterisk is a wildcard character, but you can count the cells which begin with an asterisk like this:

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

    the tilde symbol, "~", means to treat the next character as a literal, so the cell must start with an asterisk to be counted.

    Hope this helps.

    Pete

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Help with CountA

    Another way...

    =SUMPRODUCT(--(A1:A10="***********"))

    Or, maybe this one...

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

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    01-12-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    97

    Re: Help with CountA

    Quote Originally Posted by Pete_UK View Post
    The asterisk is a wildcard character, but you can count the cells which begin with an asterisk like this:

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

    the tilde symbol, "~", means to treat the next character as a literal, so the cell must start with an asterisk to be counted.

    Hope this helps.

    Pete
    Thanks a lot. It worked. Wasn't aware it was a wildcard character. Thanks to the sumproduct reply too.

  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: Help with CountA

    You're welcome!

+ 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