Show 1st, 2nd and 3rd Places With a Spreadsheet

This article will explain how to use the SORTN function in Google Sheets to find the top three places with ties.

Sorting out 1st, 2nd, and 3rd place in a spreadsheet can be tricky. While you could sort your data by the column with the values (times, weight, points, etc.), sorting won’t tell you who won first, second, and third place if there are people with the same time/score/etc. In this tutorial, we will concisely list the winners using just one function – SORTN.

We will use race times as the input, so the smallest values rank higher. The table below is our list of times from a recent race.

Run TimeFirst NameLast Name
4.77EwartAdelyn
2.97BoyceAyala
2.48AndreDuran
2.97EmmettGrant
4.50VitoHorn
3.54CarlaMarquez
5.18HoytMelton
2.48ArlineMyers
2.97WinifredRamos
3.88AdamSteinfurth

Get a copy of the race times spreadsheet with the solutions to follow along.

Top Three Times Ignoring Ties

Let’s start with showing the top three times using the SORTN function. SORTN has a built-in display_ties_mode, which we will change in the subsequent examples to give us different results.

In this first example, we will point the function to the range of A2:C11, which is the unsorted list of race results. We’ll ask for the first three results by specifying 3 for the n parameter. n is the number of results for the function to return.

Top three times
Top Three Times

Formula used in cell E4 =SORTN(A2:C11,3)

The function returns the top three times. But what about Grant Emmett (row 5) and Ramos Winifred (row 10)? They also placed third as their times are tied with Ayala‘s 2.97. Fortunately, the SORTN function handles this situation with the display_ties_mode argument. Let’s look at that next.

The Three Fastest Race Times – Including Ties

Now, let’s find the top racers that got the fastest three times, regardless of how many ties there are. To do this, we will change the display_ties_mode to 3 which shows the top three unique times, including ties.

The runners with the top three times including all ties
Top Three Times Including Ties

The report shows the first, second, and third place runners but also the runner with the third fastest time, which won’t place third because of the ties. This list of six runners may be the report you want. However, you are most likely looking for the next option. Let’s change the output to show only the runners that place in the top three spots.

First, Second, and Third Place Including Ties

This last example will show only the runners that place in the top three. It could show more than three runners, depending on the amount of ties. To do this, we will use a display_ties parameter of 1, displaying all duplicates of the third row if there are any.

The SORTN function showing the best three times and any repeats of the third value
Top Three Rows Including Ties of Last Row

The report is most likely what you are looking for. You can award first place to Andre Duran and Arline Myers, and second place to Boyce Ayala, Emmett Grant, and Winifred Ramos. There is no third place since at least three runners placed.

Video Tutorial

See a YouTube tutorial on this subject.

YouTube player

Related Pages