Search code examples
excelformulaexcel-2016mode

Mode of an horizontal text array in Excel


I have a table where I would like to know the most common value of every row, all the data is text. expected result is column D in picture

Example in picture.

I have tried this formula but it doesnt work, i only get #Value error

=INDEX(P2:R2,TRANSPOSE(MODE.MULT(IF(ISTEXT(P2:R2),MATCH(P2:R2,P2:R2,0)))))

Example table


Solution

  • You can use following array formula:

    =INDEX(A2:C2,MATCH(MAX(COUNTIF(A2:C2,A2:C2)),COUNTIF(A2:C2,A2:C2),0))
    

    Array formula after editing is confirmed by pressing ctrl + shift + enter

    enter image description here