+ Reply to Thread
Results 1 to 4 of 4

How to display a most frequent word, based on certain criteria

  1. #1
    Registered User
    Join Date
    01-05-2016
    Location
    UK
    MS-Off Ver
    2010
    Posts
    2

    Unhappy How to display a most frequent word, based on certain criteria

    Hey Guys,

    I'm hoping someone can help me with my problem. Until now I have only found a solution to return a most frequent field (using INDEX and MODE), but nothing with regards to returning the field only if it meets certain criteria.

    For example, I am trying to create a formula for a fantasy sports game, which will return the highest scoring Player that was picked the most (from a table of various lineups), but only during Team 1 vs. Team 2 games. I then want to expand this formula for Team 1 vs Team 3, 4, 5 and so on.

    I have attached a sample of my worksheet, in which incorporates the rosters of the 10 best NFL players picked by 8 different Fantasy Players over the course of 3 different game dates (each game date comprises 6 games played by each of the 12 teams against each other).

    I tried combining a MODE function together with an IF function but then got lost somewhere......

    =IF(OR(AND(C:C="Steelers",D:D="Patriots"),AND(D:D="Steelers",C:C="Patriots")),INDEX(B2:B241,MODE(IF(OR(AND(C:C="Steelers",D:D="Patriots"),AND(D:D="Steelers",C:C="Patriots")),(MATCH(B2:B241,B2:B241,0))))))

    In a nutshell, what I am trying to accomplish is as follows: I want to run an equations that will tell me if Team 1-10 will play against Team 10-1 tomorrow, then the statistics (from previous picks of those same teams playing against each other) will show that NFL players I-J will most probably be picked.

    Thanks in advance for advice/direction/ideas and what not!

    Cheers,

    Joey

    Fantasy League Stats Sample.xlsx

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: How to display a most frequent word, based on certain criteria

    Keep ranges to minimum size (I've set it to 400):

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-05-2016
    Location
    UK
    MS-Off Ver
    2010
    Posts
    2

    Re: How to display a most frequent word, based on certain criteria

    Thanks so much for the swift response! Would you mind perhaps explaining how your equation calculates the result (I'm not familiar with a few of the function), this would greatly help me in case I'd like to tweak it further.

    Thanks again!

    Joey

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: How to display a most frequent word, based on certain criteria

    This is basis of the function to find most occuring word (think of it as 'by the book'):

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Now, instead of matching in all range (red) you need to match only those that has criteria if:
    • $C$2:$C$400&$D$2:$D$400=C2&D2 (Data in range is same as cells in C and D)
    • $B$2:$B$400<>"" (Exclude empty cells)

    But now that you have criteria your formula will return error in cases where it doesn't match.
    So you need to add IFERROR to avoid errors (or MODE function won't work):

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    When you combine all of those things together you get solution:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. 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
  2. [SOLVED] Display most frequent text from a list
    By keith6292 in forum Excel General
    Replies: 5
    Last Post: 08-28-2013, 07:41 PM
  3. Find Most Frequent Word
    By Osensnolf in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 06-10-2013, 12:19 PM
  4. Replies: 4
    Last Post: 05-16-2013, 06:24 AM
  5. [SOLVED] How to get the most, second, third, forth and fifth Frequent word in a colum.
    By Basilspanellis in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2013, 06:08 AM
  6. Display most frequent occuring name
    By juliangomez in forum Excel General
    Replies: 1
    Last Post: 07-09-2012, 03:29 PM
  7. Replies: 3
    Last Post: 03-20-2012, 09:53 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