Closed Thread
Results 1 to 3 of 3

How to count the number of times a string appears in a column?

  1. #1
    btsray
    Guest

    How to count the number of times a string appears in a column?

    I have an excel worksheet with, among other things, a column in which each
    cell has a list of alpha numeric strings like, "NA998748". The column is
    several hundred rows long, and each cell contains up to 10 or 15 strings. I
    need to be able to run a function that tells me how many times each exact
    string appears in the column, which exact one appears most, etc etc. What is
    the best way to do this?

  2. #2
    Bob Phillips
    Guest

    Re: How to count the number of times a string appears in a column?

    Assuming that the string you want to count is in C1, and you are searching
    in column A, try

    =SUMPRODUCT(--(LEN(A1:A2000)-LEN(SUBSTITUTE(A1:A2000,C1,""))))/LEN(C1)

    Note that SUMPRODUCT doesn't work with complete columns, you have to specify
    a range.

    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "btsray" <[email protected]> wrote in message
    news:[email protected]...
    > I have an excel worksheet with, among other things, a column in which each
    > cell has a list of alpha numeric strings like, "NA998748". The column is
    > several hundred rows long, and each cell contains up to 10 or 15 strings.

    I
    > need to be able to run a function that tells me how many times each exact
    > string appears in the column, which exact one appears most, etc etc. What

    is
    > the best way to do this?




  3. #3
    Biff
    Guest

    Re: How to count the number of times a string appears in a column?

    Hi!

    Exact includes being case sensitive. So, NA998748 and Na998748 and na998748
    would not be matches.

    A1 = NA998748

    =SUMPRODUCT(--(ISNUMBER(FIND(A1,B1:B100))))

    If you really didn't mean "exact" replace FIND with SEARCH. Using SEARCH,
    NA998748 and Na998748 and na998748 would be matches.

    Biff

    "btsray" <[email protected]> wrote in message
    news:[email protected]...
    >I have an excel worksheet with, among other things, a column in which each
    > cell has a list of alpha numeric strings like, "NA998748". The column is
    > several hundred rows long, and each cell contains up to 10 or 15 strings.
    > I
    > need to be able to run a function that tells me how many times each exact
    > string appears in the column, which exact one appears most, etc etc. What
    > is
    > the best way to do this?




Closed 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