• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Correct MAXIFS Function to get Hotel Name

Hany ali

Active Member
Hello my Dear ,I want Your Help For Correct Function to get Hotel Name for every Guide by The largest number of repeats for this hotel ..Note The Correct Results In Column K from Total Sheet and the Functon will be in J Column ..Mistake In The Red Cells
Code:
=INDEX(Basic!$T$2:$T$1444,MATCH(MAXIFS(Basic!$S$2:$S$1444,Basic!$P$2:$P$1444,$G2),Basic!$S$2:$S$1444, 0))
 

Attachments

  • Daily Collection.xlsx
    318.2 KB · Views: 7
Which version of Excel do you have?

Your issue is that the match is looking for the relevant number anywhere in column S, not just in those rows that match the criteria in the MAXIFS function.
 
MS365
=LET(h,Basic!T2:T1444,g,Basic!P2: P1444,VLOOKUP(G2:G26,SORTBY(HSTACK(g,h),-COUNTIFS(g,g,h,h)),2,))

Old version
=INDEX(Basic!$T$2:$T$1444,MATCH(1,FREQUENCY(0,1/(COUNTIFS(Basic!$P$2:$P$1444,G2,Basic!$T$2:$T$1444,Basic!$T$2:$T$1444)+1)),))

Correction ,Slow calculation

=INDEX(Basic!$T$2:$T$1444,MATCH(MAXIFS(Basic!$S$2:$S$1444,Basic!$P$2:$P$1444,$G2),Basic!$S$2:$S$1444*(Basic!$P$2:$P$1444=G2), 0))
 

Attachments

  • Daily Collection.xlsx
    319 KB · Views: 7
Back
Top