Use the Rank and Percentile Tool from the Analysis ToolPak in Excel 2007 and Excel 2010 to create ranking tables

Updated on May 2, 2013

Introduction

Welcome to my latest hub looking into the tools available in the Analysis ToolPak which is part of both Excel 2007 and Excel 2010. In this hub, I will be investigating the Rank and Percentile Tool.

Ranking allows you to rank all your data in order from highest to lowest and Percentile allows you to easily categorise your data into percentiles such as the top 25%, top 50% etc.

To illustrate how to use this tool, I will work through an example. In my example, I have a class of 30 students. I have just got their latest results and want to rank them and assign them grades based on their ranking within the class. The top 10% get an A, the next 20% get a B, the next 20% get a C and the remainder get a D grade.

My ultimate goal is to end up with a table such as the one shown below with as little manual work as possible:

Ranking Table created using the Rank and Percentile Tool from the Analysis Toolpak in Excel 2007 and Excel 2010.
Ranking Table created using the Rank and Percentile Tool from the Analysis Toolpak in Excel 2007 and Excel 2010. | Source

In conjunction with the Rank and Percentile tool, I will use the MATCH and INDEX functions to assign the student names to the raw data created by the tool. I will then use the IF function to automatically assign a grade to them based on their result as well.

Adding the Analysis ToolPak in Excel 2007 and Excel 2010

Before using the tool, we need to ensure that the Analysis ToolPak is present in Excel. The ToolPak can be found on the Data tab, in the Analysis group and is accessed via the Data Analysis button. I have a hub that covers adding both the Developer tab and the Analysis ToolPak to both Excel 2007 and Excel 2010 which can be found here:

http://robbiecwilson.hubpages.com/hub/Using-the-Analysis-ToolPak-in-Excel-2007-and-Excel-2010

Using the Rank and Percentile Tool in Excel 2007 and Excel 2010

Now that we have added the Analysis ToolPak, select the Data Analysis button and select Rank and Percentile as shown below.

Selecting the Rank and Percentile Tool in the Analysis ToolPak using Excel 2007 and Excel 2010.
Selecting the Rank and Percentile Tool in the Analysis ToolPak using Excel 2007 and Excel 2010. | Source

The tool itself it quite straightforward and easy to use:

  • First select the Input Range
  • If your data is in columns, leave Grouped By as Columns (otherwise select Rows)
  • If you have labels for your columns, then select Labels in first row
  • Lastly, select your Output options, select Output Range to place it in a specific place on your worksheet or select New Worksheet Ply or New Workbook depending on your preference (we placed the tool’s results next to the original data in the example we are working through today)
  • Click OK and Excel will create your Rank and Percentile table

Output of the Rank and Percentile Tool, created using the Rank and Percentile Tool from the Analysis Toolpak in Excel 2007 and Excel 2010.
Output of the Rank and Percentile Tool, created using the Rank and Percentile Tool from the Analysis Toolpak in Excel 2007 and Excel 2010. | Source

You can see the output above from the tool. Excel has ranked every student and given them their exact percentile (the Percent column), however, rather than using the students names, there is a column called Point, which is the row number of each student. To turn the Point column into a column containing the student’s name, I need to turn to the MATCH and INDEX function.

Using the MATCH and INDEX function in Excel 2007 and Excel 2010 to convert the results in the Point Column created by the Rank and Percentile Tool to the actual

These two functions work in tandem to convert the results in the Point column to the student’s name.

First:

  • The MATCH function looks for the number in the Point column and then finds its exact match in the column labelled Student No.
  • INDEX then looks for the cell adjacent to the result that MATCH found and returns the student’s name.

In the figure below, you can see the formula that turns 12 in the Point column to our top student (Ed Bradley)

The MATCH and INDEX function matching the results with the student's name in Excel 2007 and Excel 2010.
The MATCH and INDEX function matching the results with the student's name in Excel 2007 and Excel 2010. | Source

The entire formula is

=INDEX($B$3:$B$32,MATCH(F5,$A$3:$A$32))

It is easier to understand broken down into its component parts, MATCH and INDEX

  • The MATCH function looks for the contents of F5 (12) in the range A3 to A32

MATCH(F5,$A$3:$A$32))

  • The INDEX function then looks in the range B3 to B32 for the cell adjacent to the cell found by MATCH

So, MATCH finds 12 in cell A14 and INDEX finds Ed Bradley in the cell adjacent to A14

Note: the $’s added to the cell references tells Excel 2007 and Excel 2010 that these cell references do not change even when the formula is copied to other cells (known as absolute cell references). This prevents Excel from adding one to each cell reference each time you copy it (the formula would become =INDEX(B4:B33,MATCH(F4,A4:A33)) rather than =INDEX($B$3:$B$32,MATCH(F4,$A$3:$A$32)) which may otherwise provide a potentially incorrect result).

I placed this formula in the column to the right of the Point column to make it easier to complete our final table with the column header of Student.

I have a hub that looks at both the MATCH and INDEX functions in far more detail, this time to create Top Ten lists which can be found here:

http://robbiecwilson.hubpages.com/hub/Using-the-MIN-and-MAX-SMALL-and-LARGE-INDEX-and-MATCH-functions-in-Excel-2007

Completing our table ranking our students in Excel 2007 and Excel 2010

Now that we have a column containing our students names, to complete the table:

  • Hide the Point and Rank columns (do not delete them or the formulas will break)
  • Copy the Percent column and place it to the right of the original column
  • Change the name of the original Percent column to Grade

Remember that we wanted to do this as automatically as possible. To assign our students a grade, we will use an IF statement as shown below:

Using an IF statement to assign student's a grade in Excel 2007 and Excel 2010.
Using an IF statement to assign student's a grade in Excel 2007 and Excel 2010. | Source

=IF(K3<50%, "D", IF(K3>90%, "A", IF(K3>70%,"B", IF(K3>50%, "C"))))

This formula looks at the Percent column and looks at the percent and then assigns a letter based on the result it finds.

Note: The order is vitally important, if we did it in the order C, B, A then we would end up with only D and C grades as Excel would look at all numbers above 50% and give them a C and the formula would end.

  • Copy this formula to the remainder of the Grade column.

Now we have our completed table, which looks like the figure below:

Completed ranking table created using the Rank and Percentile Tool, MATCH, INDEX and IF functions in Excel 2007 and Excel 2010.
Completed ranking table created using the Rank and Percentile Tool, MATCH, INDEX and IF functions in Excel 2007 and Excel 2010. | Source

Conclusion

The Rank and Percentile Tool from the Analysis ToolPak which is available in Excel 2007 and Excel 2010 allows us to work with data and rank it and then have Excel calculate its percentile.

In my example today, I took my (fictional) class of students and ranked them according to their test results. I then gave them a grade depending on where they sat ranked against their peers.

To accomplish this, I not only used the Rank and Percentile Tool, I also used the MATCH and INDEX functions to convert the results so that the name of the student appeared next to their grade, and then also used the IF command to automatically assign them their grade.

This hub is part of a series of hubs investigating the tools available in the Analysis ToolPak. The other tools I have looked at in greater depth include:

Example of a Histogram, created using the Histogram Tool from the Analysis Toolpak in Excel 2007 and Excel 2010.
Example of a Histogram, created using the Histogram Tool from the Analysis Toolpak in Excel 2007 and Excel 2010. | Source
Example of a Moving Average, created using the Moving Average Tool from the Analysis Toolpak in Excel 2007 and Excel 2010.
Example of a Moving Average, created using the Moving Average Tool from the Analysis Toolpak in Excel 2007 and Excel 2010. | Source
Example of a table showing daily variations, created using the Sampling Tool from the Analysis Toolpak in Excel 2007 and Excel 2010.
Example of a table showing daily variations, created using the Sampling Tool from the Analysis Toolpak in Excel 2007 and Excel 2010. | Source
Example of a Regression, created using the Regression Tool from the Analysis Toolpak in Excel 2007 and Excel 2010.
Example of a Regression, created using the Regression Tool from the Analysis Toolpak in Excel 2007 and Excel 2010.
Example of a Correlation, created using the Correlation Tool from the Analysis Toolpak in Excel 2007 and Excel 2010.
Example of a Correlation, created using the Correlation Tool from the Analysis Toolpak in Excel 2007 and Excel 2010.

Histogram: this tool allows us to look at the distribution of your data in graphical form. You can configure the boundary values the histogram uses to, for example, look at student exam data and chart the grade distribution across their results.

http://robbiecwilson.hubpages.com/hub/Using-the-Histogram-Tool-from-the-Analysis-ToolPak-in-Excel-2007-and-Excel-2010

Moving Average allows you to analyse your data for trends and chart your data and any trend line created by the tool should a trend be present. In my hub on this tool, I looked at my historic web traffic and whether there was a trend in that data.

http://robbiecwilson.hubpages.com/hub/Using-the-Moving-Average-Tool-from-the-Excel-2007-and-Excel-2010-Analysis-ToolPak

Sampling creates a random sample from a larger population you can analyse. I created lottery numbers from a pool in my example.

http://robbiecwilson.hubpages.com/hub/Use-the-Sampling-Tool-in-the-Excel-2007-and-Excel-2010-Analysis-ToolPak-for-sampling-and-to-analyse-periodic-variations

Regression and Correlation allow you to look at the relationship between variables. Correlation allows you to test the relationship between variables and Regression allows you to visually display this using a linear regression. In the hub on correlation, I investigate the relationship between daily temperatures and pie sales and in the hub on regression, fish mortality and Phosphate and Nitrogen concentrations in water.

http://robbiecwilson.hubpages.com/hub/Using-the-Correlation-Tool-from-the-Excel-2007-and-Excel-2010-Analysis-ToolPak

http://robbiecwilson.hubpages.com/hub/Using-the-Regression-Tool-from-the-Analysis-ToolPak-in-Excel-2007-and-Excel-2010

I do hope that you have found this hub both useful and informational. If you have any comments, please feel free to leave them below.

And Finally...

Which Tool from the Analysis ToolPak in Excel 2007 and Excel 2010 do you intend to (or already regularly) use?

See results

Questions & Answers

    Comments

      0 of 8192 characters used
      Post Comment

      No comments yet.

      working

      This website uses cookies

      As a user in the EEA, your approval is needed on a few things. To provide a better website experience, turbofuture.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

      For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://turbofuture.com/privacy-policy#gdpr

      Show Details
      Necessary
      HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
      LoginThis is necessary to sign in to the HubPages Service.
      Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
      AkismetThis is used to detect comment spam. (Privacy Policy)
      HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
      HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
      Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
      CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
      Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
      Features
      Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
      Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
      Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
      Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
      Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
      VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
      PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
      Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
      MavenThis supports the Maven widget and search functionality. (Privacy Policy)
      Marketing
      Google AdSenseThis is an ad network. (Privacy Policy)
      Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
      Index ExchangeThis is an ad network. (Privacy Policy)
      SovrnThis is an ad network. (Privacy Policy)
      Facebook AdsThis is an ad network. (Privacy Policy)
      Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
      AppNexusThis is an ad network. (Privacy Policy)
      OpenxThis is an ad network. (Privacy Policy)
      Rubicon ProjectThis is an ad network. (Privacy Policy)
      TripleLiftThis is an ad network. (Privacy Policy)
      Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
      Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
      Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
      Statistics
      Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
      ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
      Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)