+ Reply to Thread
Results 1 to 7 of 7

Function to Find Most Common Text Based on Criteria

  1. #1
    Registered User
    Join Date
    04-17-2023
    Location
    United Kingdom
    MS-Off Ver
    2016
    Posts
    5

    Function to Find Most Common Text Based on Criteria

    Hello,

    I am looking for a function, similar to SUMIF, but for text instead of numbers. I have looked at using INDEX MATCH but this does not allow me to set a criteria. The example data is below:

    Reason for Absence Department
    Injury Outside Work Production
    Cold/Flu Production
    Headache/Migraine Production
    Cold/Flu Production
    Cold/Flu Research and Design
    Cold/Flu Research and Design
    Infection Administration
    Gynaecological Administration
    Infection Administration

    I want excel to search for the criteria, e.g. Administration, and then look for the most common text in the Reason for Absence column.

    Is this possible?

    Thank you in advance.
    Last edited by ProcessG; 05-17-2023 at 09:14 AM.

  2. #2
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,069

    Re: Function to Find Most Common Text Based on Criteria

    The easiest way to do this is to use PivotTable.

  3. #3
    Registered User
    Join Date
    05-29-2020
    Location
    Indiana, USA
    MS-Off Ver
    M365
    Posts
    27

    Re: Function to Find Most Common Text Based on Criteria

    I Agree with Josephteh
    The easiest way to do this is to use PivotTable.
    If you want to use a formula, you can use
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    example attached.

    I put your data into a table (CTRL + T with headers)
    Then used
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    to get a list of values.
    Then used
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    referencing the unique so it'll spill as items are added.

  4. #4
    Registered User
    Join Date
    04-17-2023
    Location
    United Kingdom
    MS-Off Ver
    2016
    Posts
    5

    Re: Function to Find Most Common Text Based on Criteria

    Thanks! Time to watch some tutorials on Pivot Tables

  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 2403
    Posts
    44,139

    Re: Function to Find Most Common Text Based on Criteria

    or a formula compatible with your staed Excel product (excel 2016):

    =INDEX($A$2:$A$10,MODE(IF($B$2:$B$10=E1,MATCH($A$2:$A$10,$A$2:$A$10,0))))

    You seem to be using an older version of Excel than me. So, please refer to the attached file. If the formulae are enclosed within a pair of { }, these are array formulae.

    These are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see the curly brackets { } appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

    One Question... can there be TIES... with multiple values occurring n times
    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

  6. #6
    Registered User
    Join Date
    04-17-2023
    Location
    United Kingdom
    MS-Off Ver
    2016
    Posts
    5

    Re: Function to Find Most Common Text Based on Criteria

    Thanks for your reply! I found this (or something similar) online and tried it to no avail. I think I was not confirming first cell only. I have managed to get what I wanted by using a pivot table. I am still learning Excel and that seemed like the simplest way

  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 2403
    Posts
    44,139

    Re: Function to Find Most Common Text Based on Criteria

    You're welcome. I used to use PTs a lot... but since they need to be refreshed when anything is changed... I stopped using them pretty much completely.

+ 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] Find the most occurring value/text based on 2 criteria
    By THEMINROL in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-20-2022, 01:52 PM
  2. [SOLVED] Find Most Common Value with a Criteria and skipping Blanks
    By MRozell in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-28-2022, 05:10 AM
  3. 1st, 2nd & 3rd most common text based on multiple criteria?
    By CARTERLAND68 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-05-2021, 08:40 AM
  4. [SOLVED] Find most common with based on quantity
    By sealpino in forum Excel General
    Replies: 2
    Last Post: 08-23-2018, 03:16 PM
  5. [SOLVED] How to find the second occurrence text based on text criteria
    By Villalobos in forum Excel General
    Replies: 2
    Last Post: 03-03-2017, 05:31 AM
  6. Formula to find most common used text
    By tamaramb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2016, 03:24 AM
  7. function to find out count based on criteria.
    By arnab0711 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-30-2011, 06:45 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