Forum Discussion

JessicaS415's avatar
JessicaS415
Copper Contributor
Oct 14, 2024

Ranking Names in Excel

Hi all,

 

Looking for a way to attach a ranking to a name based on birthday. For example, if PersonA was born 1/1/1991 and PersonB was born 1/2/1991 then PersonA would rank 1 and PersonB would rank 2.

 

However, I also want to be able to remove someone from the list and have their rank replaced. So, if PersonA was removed, then PersonB would automatically move from rank 2 to rank 1.

 

Currently, I am using the =MAX(A$2:A2)+1 function where the ranking cell starts in A3 but I can't figure out how to "tie" the rank to the rest of the information in the filtered table. Right now, when I sort the table the rank does not tie in despite being part of the table filter

4 Replies

  • 007_Mahendran's avatar
    007_Mahendran
    Copper Contributor

    JessicaS415 

     

    List of Names and Birthdays:

    • In column A, list the names of people.
    • In column B, list their corresponding birthdays.

    Add Dynamic Ranking:

    • In column C, you can add a ranking formula that dynamically ranks the sorted names based on birthdays. Use the RANK function:
      excel
       
      =RANK(B2, B$2:B$100, 1)
       
      This ranks the birthdays in ascending order (1 for the oldest), assuming your data goes from row 2 to row 100. Adjust the range according to your actual data.

     

    Example:

    Name Birthday Rank

    PersonA1/1/19911
    PersonB1/2/19912
    PersonC1/3/19913
  • JessicaS415 

    Let's say the dates of birth are in A2:A100.

    In the rank column, enter the following formula in row 2:

     

    =RANK.EQ(A2:A100, A2:A100, 1)

    • JessicaS415's avatar
      JessicaS415
      Copper Contributor

      HansVogelaar is there a way to do this with no duplicates? For example if two people had the same birthday, they are not both ranked #5

      • Patrick2788's avatar
        Patrick2788
        Silver Contributor

        JessicaS415 

        How would you like the ties handled?

         

        I see two approaches:  HansVogelaar 's solution with RANK.EQ or using XMATCH.

         

        =XMATCH([@DOB],SORT(UNIQUE([DOB])))

         

         

        It really depends on how you'd like the duplicates (and birthdays after the dupes) handled:

         

Resources