+ Reply to Thread
Results 1 to 7 of 7

Count of Times a String Appears in an Array

  1. #1
    Registered User
    Join Date
    02-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    Count of Times a String Appears in an Array

    Hello, I'm trying to figure out a function that counts how many times a string appears in an array. Any ideas?

    An example is in the array below; "2" appears three times. The function would search for "2" and output three.

    112
    211
    12
    111

    Regards,
    Mike

  2. #2
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Count of Times a String Appears in an Array

    Hi,

    Welcome to the forum.
    Do you want to search for specific strings or alphabets in the array elements?
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  3. #3
    Registered User
    Join Date
    02-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Count of Times a String Appears in an Array

    Quote Originally Posted by Saarang84 View Post
    Hi,

    Welcome to the forum.
    Do you want to search for specific strings or alphabets in the array elements?
    A specific string of numbers within a larger number. The larger number will have random trailing and leading numbers.

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Count of Times a String Appears in an Array

    With your given example.
    Assuming that your numbers are in the range A2:A5, then try this Array Formula. Since this is an array formula so you need to confirm this with Ctrl + Shift + Enter instead of just Enter. (i.e. Select the cell where you want to put this formula --> press F2 --> paste the formula in the cell --> now hold down the Ctrl+Shift and then press Enter)

    Please Login or Register  to view this content.
    Does this help?
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  5. #5
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Count of Times a String Appears in an Array

    Can u post a workbook with sample data, showing your input and the output you want to get?

  6. #6
    Registered User
    Join Date
    02-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Count of Times a String Appears in an Array

    Quote Originally Posted by sktneer View Post
    With your given example.
    Assuming that your numbers are in the range A2:A5, then try this Array Formula. Since this is an array formula so you need to confirm this with Ctrl + Shift + Enter instead of just Enter. (i.e. Select the cell where you want to put this formula --> press F2 --> paste the formula in the cell --> now hold down the Ctrl+Shift and then press Enter)

    Please Login or Register  to view this content.
    Does this help?
    That's it. Thanks!

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Count of Times a String Appears in an Array

    You're welcome. Thanks for the feedback.
    Since you are new to the forum, so just to tell you that, if that takes care of your question, please mark your thread as solved by selecting Thread Tools (just above your first post) --> Mark thread as solved.
    Moreover you may also click on * (star) to Add Reputation to those who have put their time and efforts to help you in this forum. This is another way to say thanks to them.

+ 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. [SOLVED] Count the number of times an A appears 5 or more times consecutively
    By CCook310 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 10-02-2013, 04:02 PM
  2. find how many times a word appears in a string at certain positions within the string
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-05-2013, 12:05 AM
  3. [SOLVED] count the number of times each string appears in a column and make a summary column
    By intothewild in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-04-2012, 08:02 AM
  4. Replies: 5
    Last Post: 11-22-2010, 06:31 PM
  5. How to count the number of times a string appears in a column?
    By btsray in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-25-2006, 06:55 PM

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