+ Reply to Thread
Results 1 to 10 of 10

Macro needed to show 3 most frequently numbers apearing

  1. #1
    Forum Contributor
    Join Date
    07-01-2012
    Location
    ZA
    MS-Off Ver
    Excel 2013
    Posts
    300

    Macro needed to show 3 most frequently numbers apearing

    Good day

    I wonder if someone can help me I have 5 columns with a number in it. I want a macro that will calculate the most occurring 3 numbers out of 5nrs(from left to right) -t must count how many times it appeared.

    I want to know (example only)

    Nr 2 6 8 -occurred 15 times
    Nr 5 9 2 - occurred 8 times

    So basically the macro must count only the 3 most occurring numbers that appear going down from left to right.

    This will be highly appreciated as I have over 50 000 records and will save allot of time

    Rep given for solution

    Many thanks

    Ricklou

    Sample attached
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Macro needed to show 3 most frequently numbers apearing

    Could you use a pivot table and a count field?
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Forum Contributor
    Join Date
    07-01-2012
    Location
    ZA
    MS-Off Ver
    Excel 2013
    Posts
    300

    Re: Macro needed to show 3 most frequently numbers apearing

    Quote Originally Posted by mikeTRON View Post
    Could you use a pivot table and a count field?
    Yes or macro........I am just not good in excel got no idea how to do it -keep in mind 3 out of 5 that apear the most must be counted.

    Thanks Mike

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Macro needed to show 3 most frequently numbers apearing

    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  5. #5
    Forum Contributor
    Join Date
    07-01-2012
    Location
    ZA
    MS-Off Ver
    Excel 2013
    Posts
    300

    Re: Macro needed to show 3 most frequently numbers apearing

    Quote Originally Posted by MickG View Post
    Try this:-
    Please Login or Register  to view this content.
    Regards Mick
    Mick thank you very much I dont know if i did something wrong it says "compile error expected end with"

    Am I doing something wrong ? Thanks

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Macro needed to show 3 most frequently numbers apearing

    Sorry I left the last line of the code off when I copied it:-
    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  7. #7
    Forum Contributor
    Join Date
    07-01-2012
    Location
    ZA
    MS-Off Ver
    Excel 2013
    Posts
    300

    Re: Macro needed to show 3 most frequently numbers apearing

    Quote Originally Posted by MickG View Post
    Sorry I left the last line of the code off when I copied it:-
    Try this:-
    Please Login or Register  to view this content.
    Regards Mick
    Mick excellent coding Sir well done!!!! seems like it work but may I ask you will it list the nrs that's second most third most .....etc or will this only list the most appeared ? Can u clarify and thank you so much once again

  8. #8
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Macro needed to show 3 most frequently numbers apearing

    Try this:-
    Gives 1 to 6 largest
    Results start "K1"
    Please Login or Register  to view this content.
    Regards Mick

  9. #9
    Forum Contributor
    Join Date
    07-01-2012
    Location
    ZA
    MS-Off Ver
    Excel 2013
    Posts
    300

    Re: Macro needed to show 3 most frequently numbers apearing

    Quote Originally Posted by MickG View Post
    Try this:-
    Gives 1 to 6 largest
    Results start "K1"
    Please Login or Register  to view this content.
    Regards Mick
    Fantastic coding - works flawlessly!!!!!!!!!!!! Thank you so very much -Rep GIVEN!!!!

    Solved by Mick thanks

  10. #10
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Macro needed to show 3 most frequently numbers apearing

    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)

Similar Threads

  1. [SOLVED] Macro to Display the Top 5 Most Frequently Occurring Part Numbers
    By Hackboss007 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2014, 03:15 PM
  2. Macro or formula to find the 2 most frequently occuring numbers[SOLVED]
    By flexalong in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-14-2011, 04:34 PM
  3. Macro Needed to Manipulate Numbers
    By mkuethe in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-22-2008, 10:08 AM
  4. Apearing of List box
    By Syed Haider Ali in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-24-2008, 07:38 AM
  5. [SOLVED] To data apearing in other sheets I can use =SUM(. How I can have .
    By KP in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-18-2005, 08:06 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