+ Reply to Thread
Results 1 to 7 of 7

Return The Majority Value

  1. #1
    Forum Contributor
    Join Date
    02-13-2009
    Location
    Indiana
    MS-Off Ver
    Excel 2015
    Posts
    183

    Return The Majority Value

    Hello. I need to create a formula that will look at a row of text values and return the value that is the greatest majority. I have attached a sheet that emulates my issue.
    Attached Files Attached Files
    Last edited by sinspawn56; 10-07-2009 at 11:17 AM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Return The Majority Value

    Use this array formula:

    =INDEX($B$2:$H$2,MODE(MATCH($B$2:$H$2,$B$2:$H$2,0)))

    You must commit the formula by pressing Ctrl+Alt+ Enter keys together
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Forum Contributor
    Join Date
    02-13-2009
    Location
    Indiana
    MS-Off Ver
    Excel 2015
    Posts
    183

    Re: Return The Majority Value

    Ok, I forgot to take into account that I have 2 hidden rows between each row that has the values. I think the array you had me enter is looking at the hidden values as well. Is there a way to just select the cells that have the values?

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Return The Majority Value

    In your example you show data in a single row....but you say you have hidden rows, is your data really in a column (with hidden rows).....or a row (with hidden columns)?

  5. #5
    Forum Contributor
    Join Date
    02-13-2009
    Location
    Indiana
    MS-Off Ver
    Excel 2015
    Posts
    183

    Re: Return The Majority Value

    Sorry. I have hidden columns not rows. I want to return the majority in the single row, but I have data in column b (c,d are hidden) e (f,g are hidden) and the same row etc

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Return The Majority Value

    For the modal value for every 3rd column in B2:Z2, i.e. B2,E2,H2,K2,N2,Q2...etc try adjusting Palmetto's suggestion like this

    =INDEX(B2:Z2,MODE(IF(MOD(COLUMN(B2:Z2)-COLUMN(B2),3)=0,IF(B2:Z2<>"",MATCH(B2:Z2,B2:Z2,0)))))

    confirmed with CTRL+SHIFT+ENTER

    Adjust ranges as required

    If there are no text values that appear more than once you get #N/A error

  7. #7
    Forum Contributor
    Join Date
    02-13-2009
    Location
    Indiana
    MS-Off Ver
    Excel 2015
    Posts
    183

    Re: Return The Majority Value

    Thank you. That formula appears to be working as needed.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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