Gå til hovedindhold

Hvordan rangerer jeg rækkeviddenumre entydigt uden duplikater i Excel?

I Microsoft Excel giver den normale rangfunktion duplikatnumre den samme rang. For eksempel, hvis tallet 100 vises to gange i det valgte interval, og det første tal 100 har rang 1, vil det sidste nummer 100 også have rang 1, og dette springer nogle tal over. Men nogle gange skal du rangere disse værdier entydigt som følgende skærmbilleder vist. For flere detaljer om den unikke placering, skal du gøre som følgende tutorial vist trin for trin.

Rangér rækkenumre entydigt i faldende rækkefølge

Rangér rækkenumre entydigt i stigende rækkefølge


Rangér rækkenumre entydigt i faldende rækkefølge

I dette afsnit viser vi dig, hvordan du rangordner rækkeviddenumre i faldende rækkefølge.

Tag dataene fra nedenstående skærmbillede som eksempel, du kan se, at der er flere duplikatnumre i området A2: A11.

1. Vælg B2, kopier og indsæt formlen =RANK(A2,$A$2:$A$11,0)+COUNTIF($A$2:A2,A2)-1 ind i Formel Bar, og tryk derefter på Indtast nøgle. Se skærmbillede:

2. Derefter vises rangnummeret i cellen B2. Vælg celle B2, og placer markøren i nederste højre hjørne, når et lille sort kryds vises, træk det ned til celle B11. Så er den unikke placering vellykket. Se skærmbillede:


Rangér rækkenumre entydigt i stigende rækkefølge

Hvis du vil rangere rækkenumre entydigt i stigende rækkefølge, skal du gøre som følger.

1. Vælg celle B2, kopier og indsæt formel =RANK(A2,$A$2:$A$11,1)+COUNTIF($A$2:A2,A2)-1 ind i Formel Bar, og tryk derefter på Indtast nøgle. Derefter vises det første rangnummer i celle B2.

2. Vælg celle B2, træk påfyldningshåndtaget ned til celle B11, så er den unikke placering færdig.

Bedste kontorproduktivitetsværktøjer

Populære funktioner: Find, fremhæv eller identificer dubletter   |  Slet tomme rækker   |  Kombiner kolonner eller celler uden at miste data   |   Runde uden formel ...
Super opslag: VLookup med flere kriterier    Multiple Value VLookup  |   VOpslag på tværs af flere ark   |   Fuzzy Lookup ....
Avanceret rulleliste: Opret hurtigt rulleliste   |  Afhængig rulleliste   |  Multivælg rulleliste ....
Column Manager: Tilføj et bestemt antal kolonner  |  Flyt kolonner  |  Skift synlighedsstatus for skjulte kolonner  |  Sammenlign områder og kolonner ...
Fremhævede funktioner: Grid fokus   |  Designvisning   |   Stor Formel Bar    Arbejdsbog & Ark Manager   |  Ressourcebibliotek (Autotekst)   |  Datovælger   |  Kombiner regneark   |  Krypter/Dekrypter celler    Send e-mails efter liste   |  Superfilter   |   Specielt filter (filter fed/kursiv/gennemstreget...) ...
Top 15 værktøjssæt12 tekst Værktøj (tilføje tekst, Fjern tegn, ...)   |   50 + Chart Typer (Gantt kort, ...)   |   40+ Praktisk formler (Beregn alder baseret på fødselsdag, ...)   |   19 Indsættelse Værktøj (Indsæt QR-kode, Indsæt billede fra sti, ...)   |   12 Konvertering Værktøj (Tal til ord, Valutaomregning, ...)   |   7 Flet og del Værktøj (Avancerede kombinere rækker, Opdel celler, ...)   |   ... og mere

Overlad dine Excel-færdigheder med Kutools til Excel, og oplev effektivitet som aldrig før. Kutools til Excel tilbyder over 300 avancerede funktioner for at øge produktiviteten og spare tid.  Klik her for at få den funktion, du har mest brug for...

kte-fane 201905


Fanen Office bringer en grænseflade til et kontor med Office, og gør dit arbejde meget lettere

  • Aktiver redigering og læsning af faner i Word, Excel, PowerPoint, Publisher, Access, Visio og Project.
  • Åbn og opret flere dokumenter i nye faner i det samme vindue snarere end i nye vinduer.
  • Øger din produktivitet med 50 % og reducerer hundredvis af museklik for dig hver dag!
Comments (25)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hey so I just worked on this formula for the past 45 minutes. The above formula is wrong, the output does provide duplicates but that is only because the countif range is not accounting for the entire range.

Above the descending formula is: =RANK(A2,$A$2:$A$11,0)+COUNTIF($A$2:A2,A2)-1

The bold/underlined A2 cell should be equal to the ending of the range which is A11. Which would make correct forumla stance:

=round(RANK(A2,$A$2:$A$11,0)+COUNTIF($A$2:A7,A2)-1

For visuals, on my sheet I created a leader tracking board with the following formula and I got no duplicates see below 2 images with duplicate numbers but different ranking levels:


My Descending formula: =round(RANK(D7,$D$7:$BY$7)+countif($D$7:$BY$7,D7)-1)
Key Notes:
- My range is locked
- D7 is the start of my range and BY7 is the end of my range
- I have added the round formula to account for any decimals
- the (-1) will automatically subtract from the previous ranking.
This comment was minimized by the moderator on the site
Hi Zoe,
Thank you for your feedback. I will check the formula and make the changes.
This comment was minimized by the moderator on the site
It's very helpful content. Thank You so much.
This comment was minimized by the moderator on the site
Thank you for the solution! Works perfectly!
This comment was minimized by the moderator on the site
This tip was PERFECT in solving my sorting issue! Thanks very much!!!
This comment was minimized by the moderator on the site
I still have duplicate rankings. Before I used COUNTIF the rankings were 4 for both, now they are both ranked 5 with COUNTIF BUT in my chart, it will only list one of the items twice instead of listing both items. Here is my formula: =RANK(V3,V$3:V$30, 1)+COUNTIF(V$3:V$30:V3,V3)-1
In the ranking chart it displays rank 4 as team 1 and rank 5 as team 1 since team 1 and team 2 have the same rank, team 2 is not listed. Here is the formula for those cells:=INDEX($L$3:$L$30,MATCH(SMALL($V$3:$V$30,Y3),$V$3:$V$30,0))
How do I make sure teams that are tied do not get left off list?


This comment was minimized by the moderator on the site
Formulas for unique ascending and descending are identical. Ascending should be: =RANK(A2,$A$2:$A$11,1)+COUNTIF(A2:$A$2,A2)-1.
This comment was minimized by the moderator on the site
if you see the below ranking, where the duplicate numbers found, number is missing.
Exmples
After 23 it goes to 25, after 29 it goes to 30, Formula miss the next number like - 24 & 29

Score Rank

4661 21

4650 22

4648 23

4645 25

4645 25

4644 26

4629 27

4626 28

4595 30

4595 30

4578 31

4438 32
This comment was minimized by the moderator on the site
What's the formula for this ranking where it combines same values into one ranking???
This comment was minimized by the moderator on the site
Hi, This formula just ranks all numbers in ascending/descending order and doesn't combine the duplicates into one rank. How do I combine the ranking for duplicates, for example two duplicate 100s to be combined and both ranked as 1, 3 duplicate 90s to be combined and ranked as 2, 2 duplicate 80s ranked as 3, etc.? In your example of total 10 students I want a formula that will rank the two 100s as 1, rank the two 90s as 2, rank the two 80s as 3, etc. Please help. Thanks
This comment was minimized by the moderator on the site
if you do want this kind of ranking, what I would do is copy the whole list somewhere else, then use remove duplicates in the Data menu to leave only the individual values. rank these individual scores using a standard RANK formula and then use a simple VLOOKUP formula to return the value against the score in the full list.

this will show the values the way you want above.
This comment was minimized by the moderator on the site
Why do you need to do this? a standard RANK formula will rank these examples as 1, 1, 3, 3, 5, 5. this is a much more usual way of ranking as if there are 2 first places the next in line would usually logically be 3rd not 2nd.
This comment was minimized by the moderator on the site
The formula doesn't seem to work sometimes, and I think it might be due to a rounding error. RANK and COUNTIF probably treat rounding differently. If I first use ROUND on the range I want to rank it seems to work.
This comment was minimized by the moderator on the site
Thanks Jack, from the future!
This comment was minimized by the moderator on the site
This is absolutely key. I've often encountered an error where it would still randomly duplicate a few ranks using this method and could not for the life of me work out why, really frustrating, especially if you need a complete set of rankings for lookups elsewhere - overriding / typing simply not an option. Jack has nailed this. Round the range you want to rank (even if it's in a separate column so you don't affect the integrity of your data), problem solved. Thanks Jack!!
This comment was minimized by the moderator on the site
Thank you so much! Love the solution.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations