+ Reply to Thread
Results 1 to 13 of 13

Number of occurences for the most repeated value

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Number of occurences for the most repeated value

    Hello everybody

    In my attachment I'm trying to find the most occurrences of all values and in adjacent column to count the number of occurrences ..
    Expected output in Columns("I:J")
    If possible I need to creat UDF function that do that task ...
    That's extract unique values from the range("A2:D21") then sort the values according to the most occurrences ...
    Hope it is clear
    Thanks advaced
    Attached Files Attached Files
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Number of occurences for the most repeated value

    In J2, copied down:
    =LARGE(G:G, ROW(A1))

    In I2, copied down, this array formula:
    =INDEX($F$1:$F$37, SMALL(IF($G$1:$G$37=J2, ROW($F$1:$F$37), ""), COUNTIF($J$1:$J2, $J2)))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Number of occurences for the most repeated value

    Thanks a lot for help
    In fact Columns G:H is just my try to solve the problem
    I need to deal with the range("A2:D21") directly and get the results in Columns I:J
    Thanks for swift reply

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Number of occurences for the most repeated value

    Why exactly is that needful?

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Number of occurences for the most repeated value

    No, function, but have a sub. Do you want it?

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Number of occurences for the most repeated value

    Ok Mr AB33 ...
    It's my pleasure to receive your gift of course as I said "If possible" ..
    Thanks advanced

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Number of occurences for the most repeated value

    Okay, try then

    Note: Amended
    Attached Files Attached Files
    Last edited by AB33; 11-12-2015 at 12:00 PM.

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Number of occurences for the most repeated value

    Thank you very much for this unique help
    It's working like charm
    Regards

  9. #9
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Number of occurences for the most repeated value

    If you need the UDF anyway :

    Please Login or Register  to view this content.

  10. #10
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Number of occurences for the most repeated value

    Great as usual Mr. Karedog
    I tested it and it works in excellent way ..for both columns

    Just if possible there are N/A error appears at the end of results .. Is it possible to show empty results instead of the N/A error?

  11. #11
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Number of occurences for the most repeated value

    This should do :
    Please Login or Register  to view this content.

  12. #12
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Number of occurences for the most repeated value

    Thank you very very much for all these great and huge help here and there and everywhere ...
    You are really my dear friend(don't replace the letter "d" with "b") ..

  13. #13
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Number of occurences for the most repeated value

    You are welcome, I will "d"ear it in mind


    Regards

+ 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. Count number of occurences
    By pedrotairum in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-03-2014, 03:45 AM
  2. count the number of duplicates and print the number of occurences
    By ash81sen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2010, 01:21 PM
  3. Count the number of occurences of a value
    By therealjag in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2010, 06:25 AM
  4. Number of occurences
    By n0kx in forum Excel General
    Replies: 2
    Last Post: 02-24-2009, 01:02 PM
  5. Number of occurences
    By kc27315 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-06-2008, 08:48 AM
  6. [SOLVED] Chart number of occurences
    By David P. in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-23-2006, 04:15 PM
  7. Paste a value a set number of occurences
    By Larry in forum Excel General
    Replies: 0
    Last Post: 02-15-2006, 10:20 AM

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