X Lookup returning multiple matches

%3CLINGO-SUB%20id%3D%22lingo-sub-2829186%22%20slang%3D%22en-US%22%3EX%20Lookup%20returning%20multiple%20matches%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2829186%22%20slang%3D%22en-US%22%3E%3CP%3EHi.%20I'm%20trying%20to%20show%20a%20list%20of%20placings%2C%20i.e.%201st%2C%202nd%2C%203rd%2C%20etc.%20but%20when%20there%20are%20more%20than%202%20with%20the%20same%20amount%2C%20it%20puts%20that%20person%20twice.%20How%20can%20I%20fix%20this%20so%20it%20shows%20the%20correct%20placings%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2829186%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2829273%22%20slang%3D%22en-US%22%3ERe%3A%20X%20Lookup%20returning%20multiple%20matches%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2829273%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1180288%22%20target%3D%22_blank%22%3E%40LizM1980%3C%2FA%3E%26nbsp%3BLooking%20at%20your%20formula%2C%20I%20see%20what%20you%20are%20trying%20to%20achieve.%20But%2C%20that's%20not%20going%20to%20work.%20For%20example%2C%20the%20formula%20in%20G5%20looks%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DXLOOKUP(H5%2C%24B%242%3A%24B%2415%2C%24A%242%3A%24A%2415%2C%22n%2Fa%22%2C%3CSTRONG%3E%3CFONT%20color%3D%22%23FF0000%22%3EIFG5%3DG4%3C%2FFONT%3E%3C%2FSTRONG%3E%2C%3CFONT%20color%3D%22%23FF0000%22%3E%3CSTRONG%3E-1%3C%2FSTRONG%3E%3C%2FFONT%3E)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%205th%20and%206th%20arguments%20(bold%2C%20red)%20%26nbsp%3Byou%20are%20trying%20to%20say%20%22if%20the%20number%20in%20G5%20equals%20G4%2C%20then%20search%20from%20the%20bottom%20up.%22%20But%20the%205th%20argument%20is%20comparing%20the%20value%20in%20cell%20IFG5%20(i.e.%20column%20IFG%2C%20row%205)%20with%20that%20of%20G4.%20Since%20you%20have%20no%20values%20in%20column%20IFG%2C%20this%20will%20always%20return%20FALSE%20(%3D0)%20which%20tells%20the%20function%20to%20search%20for%20an%20exact%20match.%20The%206th%20argument%20-1%20triggers%20the%20bottom-up%20search.%20So%2C%20not%20really%20what%20you%20are%20trying%20to%20achieve.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEven%20when%20it%20had%20been%20possible%2C%20it%20would%20not%20have%20worked%20how%20you%20desire.%20XLOOKUP%20can%20search%20top%20down%20or%20bottom%20up.%20That%20allows%20you%20to%20find%20either%20the%20first%20or%20last%20match%20in%20a%20list%2C%20but%20not%20any%20of%20the%20ones%20in%20between.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20need%20to%20make%20all%20scores%20unique%20for%20a%20lookup%20function%20to%20find%20all%20matching%20scores.%20With%20a%20helper%20column%20you%20can%20add%20a%20very%20small%20fraction%20to%20each%20score.%20But%20when%20you%20suppress%20the%20decimals%20the%20scores%20will%20look%20like%20the%20original%20ones.%20I've%20demonstrated%20that%20in%20the%20attached%20file.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2829323%22%20slang%3D%22en-US%22%3ERe%3A%20X%20Lookup%20returning%20multiple%20matches%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2829323%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3BThanks%2C%20but%20I%20actually%20have%20other%20data%20that's%20adding%20up%20to%20get%20my%20%22total%22%20so%20I%20can't%20just%20slightly%20change%20the%20amounts.%3C%2FP%3E%3CP%3EDo%20you%20know%20another%20way%20I%20can%20achieve%20these%20placings%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2829332%22%20slang%3D%22en-US%22%3ERe%3A%20X%20Lookup%20returning%20multiple%20matches%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2829332%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1180288%22%20target%3D%22_blank%22%3E%40LizM1980%3C%2FA%3E%26nbsp%3BWhy%20not%20share%20a%20workbook%20that%20accurately%20represents%20what%20you%20want%20to%20achieve.%20Then%20I%2Fwe%20don't%20have%20to%20guess.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi. I'm trying to show a list of placings, i.e. 1st, 2nd, 3rd, etc. but when there are more than 2 with the same amount, it puts that person twice. How can I fix this so it shows the correct placings?

7 Replies

@LizM1980 Looking at your formula, I see what you are trying to achieve. But, that's not going to work. For example, the formula in G5 looks like this:

 

=XLOOKUP(H5,$B$2:$B$15,$A$2:$A$15,"n/a",IFG5=G4,-1)

 

In the 5th and 6th arguments (bold, red)  you are trying to say "if the number in G5 equals G4, then search from the bottom up." But the 5th argument is comparing the value in cell IFG5 (i.e. column IFG, row 5) with that of G4. Since you have no values in column IFG, this will always return FALSE (=0) which tells the function to search for an exact match. The 6th argument -1 triggers the bottom-up search. So, not really what you are trying to achieve.

 

Even when it had been possible, it would not have worked how you desire. XLOOKUP can search top down or bottom up. That allows you to find either the first or last match in a list, but not any of the ones in between.

 

You need to make all scores unique for a lookup function to find all matching scores. With a helper column you can add a very small fraction to each score. But when you suppress the decimals the scores will look like the original ones. I've demonstrated that in the attached file.

 

@Riny_van_Eekelen Thanks, but I actually have other data that's adding up to get my "total" so I can't just slightly change the amounts.

Do you know another way I can achieve these placings?

@LizM1980 Why not share a workbook that accurately represents what you want to achieve. Then I/we don't have to guess.

@Riny_van_Eekelen sorry, I have now added other relevant data. hopefully this helps

@LizM1980 

I would change the structure and then do a pivot table.

But I also included a formula solution.

 

@LizM1980 Thanks! Not sure I understand what I'm looking at, but I would begin by rearranging the data. Rather than having two rows per person and merged cells, I prefer to use a structured table with one row per person. One column for the name, followed by 5 columns with numbers between 1 and 10, followed by 5 columns that lookup the correct values from another structured table. Then a TOTAL for the 5 lookup results and then a column for the Ranking, sorted Smallest to Largest. Now you can use the first 10 rows for a Top 10 listing.

 

oh yeah, of course. Why didn't I think of that! Thankyou