+ Reply to Thread
Results 1 to 10 of 10

Code that Counts number of time string occurs in a column

  1. #1
    Registered User
    Join Date
    07-05-2014
    Location
    Nigeria
    MS-Off Ver
    Ms Office 13
    Posts
    12

    Code that Counts number of time string occurs in a column

    Hello everyone.

    I need a code that search through a column, counts the numer of times a string occurs and creates on another sheet the unique string and the number of times it occured.

    e.g

    I have this columns in a worksheet

    s/n name company trainer
    1 ball Dell Mk
    2 doll Msed Kl
    3 kol Dlink Mk
    4 ball Msed Cl
    5 Koll Dell Gl

    I need the result to appear on another worksheet like this

    Name NumberofTraining
    Ball 2
    doll 1
    Koll 2

    Thanks Guys

    In anticipation of your response

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Code that Counts number of time string occurs in a column

    Try this out & let me know...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    07-05-2014
    Location
    Nigeria
    MS-Off Ver
    Ms Office 13
    Posts
    12

    Re: Code that Counts number of time string occurs in a column

    Thanks.. its quite helpful but let me add an attachment so that you will have a perfect understanding of what i want to do.autogra.xlsx

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Code that Counts number of time string occurs in a column

    Sooooo much easer with a sheet to work on.
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Code that Counts number of time string occurs in a column

    Currently, the equations as set to work for the highlighted cell ranges and will all update automatically in those ranges.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-05-2014
    Location
    Nigeria
    MS-Off Ver
    Ms Office 13
    Posts
    12

    Re: Code that Counts number of time string occurs in a column

    Quote Originally Posted by Glenn Kennedy View Post
    Sooooo much easer with a sheet to work on.
    Thanks Glenn

    But i need a button on the data page (as from the user side this is the only page) and by pressing the button it comes up with the result sheet

    Thanks Again

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Code that Counts number of time string occurs in a column

    I'm really not quite sure what you mean...

  8. #8
    Registered User
    Join Date
    07-05-2014
    Location
    Nigeria
    MS-Off Ver
    Ms Office 13
    Posts
    12

    Re: Code that Counts number of time string occurs in a column

    Quote Originally Posted by Glenn Kennedy View Post
    I'm really not quite sure what you mean...
    instead of using functions on the worksheets, can it be done by using macros such that when the macro is run it gives the result sheet

  9. #9
    Registered User
    Join Date
    07-05-2014
    Location
    Nigeria
    MS-Off Ver
    Ms Office 13
    Posts
    12

    Re: Code that Counts number of time string occurs in a column

    Hello Glenn

    Can the range be increased to 3000 rows instead of the 30 you used.

    Thanks in aticipation of your kind help.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Code that Counts number of time string occurs in a column

    Sure. Done. I always tend to put a bit of colour onto ranges (manually) to show where the formulae start & stop.

    If that's it, can you mark the thread as solved and (preferably) click the Add reputation button at the foot of this post.
    Attached Files Attached Files

+ 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. Chart which shows number of time values occurs
    By dominion in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-19-2013, 05:36 PM
  2. Counting the number of times a text string occurs in a cell
    By Geoff1184 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-12-2012, 04:07 PM
  3. [SOLVED] Average number of times a text string occurs
    By anguschap in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-04-2012, 08:22 PM
  4. [SOLVED] count the number of times a string occurs in a range based on a condition
    By sshishirkumar in forum Excel General
    Replies: 6
    Last Post: 05-29-2012, 04:00 AM
  5. Replies: 2
    Last Post: 09-09-2008, 09:26 PM

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