Forum Discussion
XLOOKUP not working for multiple criteria
Hello Sturmrider,
Your formula is not working because you are trying to match the high score and multiple criteria inside XLOOKUP at the same time. This creates multiple matches and XLOOKUP returns the first one it finds, which is not reliable.
Use this formula instead:
=LET(
scores, FILTER(GameStats[Score], (GameStats[Board Game]=[@[Board Game]])(GameStats[Board / Scenario]=[@[Board / Scenario]])),
players, FILTER(GameStats[Player], (GameStats[Board Game]=[@[Board Game]])(GameStats[Board / Scenario]=[@[Board / Scenario]])),
XLOOKUP(MAX(scores), scores, players)
)
This filters the data to the selected board game and scenario, finds the highest score in that subset, and returns the player for that score.
If more than one player has the same high score, it returns the first match.
I am hoping this reply shows up I made six yesterday and none of them have appeared. Here is what happened when i entered your formula into the worksheet:
I am wondering if it is because the Game Stats are on a different worksheet. I have been trying to figure out how to upload the workbook, but I see ways to put a link in for a url or a method to upload media I must be missing something because I figured that would be the easiest way for someone to figure it out. Thank you for your help I will keep trying and maybe the moderators will let this one post.