Closed Thread
Results 1 to 11 of 11

Second & Third most frequent text with criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    07-03-2019
    Location
    Cincinnati, OH
    MS-Off Ver
    Office 365 Subscription
    Posts
    3

    Second & Third most frequent text with criteria

    I have been able to successfully input the most frequently occurring text in a range based on criteria by using an array formula based on the INDEX, MATCH, MODE, and IF functions.

    I also need to find the 2nd most frequent occuring text in a range based on criteria as well as the 3rd most frequent using a variation of the formula but don't know how to go about editing the formula to accomplish this.

    Here is the formula I created to get most frequent state based on ID: =INDEX(State,MODE(IF(ID =D3,MATCH(State,State,0)))) where ID = A2:A22 and State = B2:B22. I am unable to share a screenshot but will add as a table below.
    Attached Images Attached Images

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Second & Third most frequent text with criteria

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Second & Third most frequent text with criteria

    I agree attaching a sample would be more helpful

    I can be done with formulas but they would be complicated and probably need helper columns. the below is just 1 column not 2
    https://www.mrexcel.com/forum/excel-...ues-range.html

    I would pivot the data with ID and state as rows, count of state as the value, and sort by the values descending

    this should be fairly easy to pick from to complete your table, but if you attach a sheet would be quick to do

  4. #4
    Registered User
    Join Date
    07-03-2019
    Location
    Cincinnati, OH
    MS-Off Ver
    Office 365 Subscription
    Posts
    3

    Re: Second & Third most frequent text with criteria

    I believe I have attached the source file. Let me know if you have any issues!
    Attached Files Attached Files

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,725

    Re: Second & Third most frequent text with criteria

    Hello TristanPKT. Welcome to the forum and Happy Independence Day!!!

    Try array entering this formula in E3. Fill down and across until you get blanks.

    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    =IFERROR(INDEX($B$2:$B$25,MODE.MULT(IF(($D3=$A$2:$A$25)*
    ISNA(MATCH($B$2:$B$25,$D3:D3,0)),MATCH($B$2:$B$25,$B$2:$B$25,0)+{0,0}))),"")



    D
    E
    F
    G
    1
    2
    ID
    #1 State
    #2 State
    #3 State
    3
    A1
    KY
    OH
    IN
    4
    A2
    FL
    GA
    NC
    5
    A3
    NY
    MA
    PA
    6
    A4
    CA
    WA
    OR
    7
    Dave

  6. #6
    Registered User
    Join Date
    07-03-2019
    Location
    Cincinnati, OH
    MS-Off Ver
    Office 365 Subscription
    Posts
    3

    Re: Second & Third most frequent text with criteria

    This worked!! Thanks so much!
    Last edited by AliGW; 07-05-2019 at 03:19 AM. Reason: Please don't quote unnecessarily!

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,890

    Re: Second & Third most frequent text with criteria

    Quote Originally Posted by TristanPKT View Post
    This worked!! Thanks so much!
    We have asked you to mark this SOLVED but you seem to have abandoned us altogether. So I'm marking it SOLVED and closing it.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,725

    Re: Second & Third most frequent text with criteria

    You are welcome. Thank you for the feedback and added rep.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  9. #9
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Second & Third most frequent text with criteria

    I'm impressed, a bit of exercising the old grey matter to understand it. Will file it away for future use!

  10. #10
    Registered User
    Join Date
    11-20-2024
    Location
    MN
    MS-Off Ver
    365
    Posts
    1

    Re: Second & Third most frequent text with criteria

    I get 1st most common repeatedly with this formula. Can anyone tell me why?

  11. #11
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,890

    Re: Second & Third most frequent text with criteria

    Quote Originally Posted by dy24 View Post
    I get 1st most common repeatedly with this formula. Can anyone tell me why?
    To answer this we need to see your data and exactly what formula you are using.

    Since this question was answered over 5 years ago, and your question is about your file, you need to start a new thread. Attach a file with sample data showing your formula, and also indicate what result you were expecting to see and why that should be the result.



    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #1 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to display a most frequent word, based on certain criteria
    By JoeyPeeps in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-05-2016, 02:24 PM
  2. Most Frequent text within a range under specific criteria
    By afronight_76 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-29-2014, 12:16 PM
  3. Determining the most frequent text (1st 2nd and 3rd) in a range in excel...
    By keller101 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-26-2013, 11:43 PM
  4. [SOLVED] Display most frequent text from a list
    By keith6292 in forum Excel General
    Replies: 5
    Last Post: 08-28-2013, 07:41 PM
  5. Replies: 3
    Last Post: 03-20-2012, 09:53 PM
  6. How to sort data by the most frequent text value?
    By Kazabu in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-18-2009, 06:27 AM
  7. Most Frequent Text String
    By Bretto75 in forum Excel General
    Replies: 23
    Last Post: 06-01-2009, 12:42 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