Reverse ordering in excel

Excel Reverse Order

Excel Reverse Order (Table of Contents)

  • Introduction to Excel Reverse Order
  • Methods to Reverse Column Order

Introduction to Excel Reverse Order

Reversing the order is nothing but flipping the column values; this means the last value in your column should be the first value in reversed order and the second last should be the second value and going on, the first value should be the one that gets entered at last in a reversed column. Well, it seems to be a pretty simple one-click task when you hear it out at first. However, it is not. Because there is no one-click button in Excel that does this task for you, besides it is really very hard to use the traditional Sort function as it only can sort the values based on the sorting order alphabetically or numerically and not with the flipping preferences. However, these are not the only, and you may come up with some creativity, your own ways to get the task done.

Let us see different methods that can be used to reverse the column order. Suppose we have data as shown below:

Excel Reverse Order 1-1

Column A consists of data, as you can see, that is not sorted. Here, we wanted the order to be reversed (column flip) in a way that Dan should appear first in a Reversed column and then Bob and likewise, Alvin should come as last in a Reversed column.

Methods to Reverse Column Order

Let’s understand the techniques to Reverse Column Order with a few methods.

You can download this Reverse Order Excel Template here – Reverse Order Excel Template

Methods #1 – Conventional Sort Method

Step 1: Add a column named Order after column A (Data) and try typing the numbers starting from 1,2. These numbers will be the order references for data values under column A.

Excel Reverse Order 1-2

Step 2: Now, select the first two cells in the column named Order (column B) and then drag it down until B11 to get the sequential numbers from 1 to 10 across B1:B11.

Excel Reverse Order 1-3

Step 3: Select the entire column B Data (B1:B11) and navigate to the Data tab in the Excel Ribbon. Within the Data tab, under the Sort & Filter group, click on the Sort Z to A (Highest to Lowest) button.

Excel Reverse Order 1-4

Step 4: As soon as you click on the Sort Z to A button, you’ll get a warning message from the function. As shown below. Don’t change anything in the default selection in that message box and click on the Sort button.

Excel Reverse Order 1-5

As soon as you click on the Sort button, you could see that the data has been sorted based on column B (named Order) values as Largest to Smallest and accordingly, column A values have also changed their places. Now, you can see Dan as the first entry in column A, Bob as second and going on, Alvin as the last entry.

Excel Reverse Order 1-6

This is one way to reverse the order of a column or flip the column.

Methods #2 – Using Excel Formula

You can see that column A consists of all the names starting from Alvin up to Dan. Now, column B, named Reversed, is something where we will be adding a generic formula that can look up and add the values as flipped from column A. Which means the sequence will be Dan as first, Bob as second and going so on, Alvin will be the last entry under column B.

Using Excel Formula 2-1

Step 1: In cell B2, start typing the INDEX formula and use $A2:$A$11 as an absolute reference to it (hit keyboard F4 button once to convert the reference into an absolute one).

Using Excel Formula 2-2

Step 2: Now, use the ROWS function to add the relative row references. Use the same data reference inside the ROWS function (A2:A$11); however, this time, use F4 to make A11 as absolute.

Using Excel Formula 2-3

Step 3: Add two closing parentheses for ROWS as well as the INDEX function, and this formula is complete. You can press the Enter key as well as drag this formula across B2:B11 to get the desired result.

Using Excel Formula 2-4

Things to Remember About Excel Reverse Order

  • Excel doesn’t have any built-in function that reverses/flips the column order. It can be achieved with different formulae and their combinations.
  • Excel SORT seems to be the best, simple yet faster way to achieve the order reversal or order flipping of a column.
  • However, at the same time, using a combination of INDEX and ROWS function is more generic since it doesn’t alter the original order preference, and you still can have your values in original order if you changed your mind from flipping the column order.

Recommended Articles

This is a guide to Excel Reverse Order. Here we discuss How to Reverse Column Order in Excel along with practical examples and a downloadable excel template. You can also go through our other suggested articles –

  1. Trunc in Excel
  2. Compare Two Lists in Excel
  3. Logical Functions in Excel
  4. Sort Column in Excel

Sometimes, you may have a need to flip the data in Excel, i.e., to reverse the order of the data upside down in a vertical dataset and left to right in a horizontal dataset.

Now, if you’re thinking that there must be an inbuilt feature to do this in Excel, I’m afraid you’d be disappointed.

While there are multiple ways you can flip the data in Excel, there is no inbuilt feature. But you can easily do this using simple a sorting trick, formulas, or VBA.

In this tutorial, I will show you how to flip the data in rows, columns, and tables in Excel.

So let’s get started!

Flip Data Using SORT and Helper Column

One of the easiest ways to reverse the order of the data in Excel would be to use a helper column and then use that helper column to sort the data.

Flip the Data Vertically (Reverse Order Upside Down)

Suppose you have a data set of names in a column as shown below and you want to flip this data:

Vertical Dataset to Flip

Below are the steps to flip the data vertically:

  1. In the adjacent column, enter ‘Helper’ as the heading for the column
  2. In the helper column, enter a series of numbers (1,2,3, and so on). You can use the methods shown here to do this quicklyHelper column for flipping vertical data
  3. Select the entire data set including the helper column
  4. Click the Data tabClick the Data tab
  5. Click on the Sort iconClick the Sort icon
  6. In the Sort dialog box, select ‘Helper’ in the ‘Sort by’ dropdownSelect Helper column for sorting
  7. In the Order drop-down, select ‘Largest to Smallest’Select Largest to Smallest sorting
  8. Click OK

The above steps would sort the data based on the helper column values, which would also lead to reversing the order of the names in the data.

Data flipped vertically

Once done, feel free to delete the helper column.

In this example, I’ve shown you how to flip the data when you just have one column, but you can also use the same technique if you have an entire table. Just make sure that you select the entire table and then use the helper column to sort the data in descending order.

Flip the Data Horizontally

You can also follow the same methodology to flip the data horizontally in Excel.

Excel has an option to sort the data horizontally using the Sort dialog box (the ‘Sort left to right’ feature).

Suppose you have a table as shown below and you want to flip this data horizontally.

Horizontal Dataset

Below are the steps to do this:

  1. In the row below, enter ‘Helper’ as the heading for the row
  2. In the helper row, enter a series of numbers (1,2,3, and so on).Horizontal Dataset
  3. Select the entire data set including the helper row
  4. Click the Data tab
  5. Click on the Sort icon
  6. In the Sort dialog box, click on the Options button.Click the Option button in Sort dialog box
  7. In the dialog box that opens, click on ‘Sort left to right’click on Sort left ot right
  8. Click OK
  9. In the Sort by drop-down, select Row 3 (or whatever row has your helper column)Select the helper row number
  10. In the Order drop-down, select ‘Largest to Smallest’Select Largest to Smallest for sorting
  11. Click OK

The above steps would flip the entire table horizontally.

Horizontal Data flipped

Once done, you can remove the helper row.

Flip Data Using Formulas

Microsoft 365 has got some new formulas that make it really easy to reverse the order of a column or a table in Excel.

In this section, I’ll show you how to do this using the SORTBY formula (if you’re using Microsoft 365), or the INDEX formula (if you’re not using Microsoft 365)

Using the SORTBY function (available in Microsoft 365)

Suppose you have a table as shown below and you want to flip the data in this table:

Data to be flipped by SORTBY

To do this, first, copy the headers and place them where you would want the flipped table

Copy the headers in a different place

Now, use the following formula below the cell in the left-most header:

=SORTBY($A$2:$B$12,ROW(A2:A12),-1)
SORTBY function to flip the data

The above formula sorts the data and by using the result of the ROW function as the basis to sort it.

The ROW function in this case would return an array of numbers that represents the row numbers in between the specified range (which in this example would be a series of numbers such as 2, 3, 4, and so on).

And since the third argument of this formula is -1, it would force the formula to sort the data in descending order.

The record that has the highest row number would come at the top and the one which has the lowest rule number would go at the bottom, essentially reversing the order of the data.

Once done, you can convert the formula to values to get a static table.

Using the INDEX Function

In case you don’t have access to the SORTBY function, worry not – you can use the amazing INDEX function.

Suppose you have a dataset of names as shown below and you want to flip this data.

Single column data for index function

Below is the formula to do this:

=INDEX($A$2:$A$12,ROWS(A2:$A$12))
INDEX function to flip 1 column

 How does this formula work?

The above formula uses the INDEX function that would return the value from the cell based on the number specified in the second argument.

The real magic happens in the second argument where I have used the ROWS function.

Since I have locked the second part of the reference in the ROWS function, in the first cell, it would return the number of rows between A2 and A12, which would be 11.

But when it goes down the rows, the first reference would change to A3, and then A4, and so on, while the second reference would remain as is because I have locked it and made it absolute.

As we go down the rows, the result of the ROWS function would decrease by 1, from 11 to 10 to 9, and so on.

And since the INDEX function returns us the value based on the number in the second argument, this would ultimately give us the data in the reverse order.

You can use the same formula even if you have multiple columns in the data set. however, you will have to specify a second argument that would specify the column number from which the data needs to be fetched.

Suppose you have a data set as shown below and you want to reverse the order of the entire table:

Two data column for index function sort

Below is the formula that will do that for you:

=INDEX($A$2:$B$12,ROWS(A2:$A$12),COLUMNS($A$2:A2))
INDEX formula to sort multiple columns

This is a similar formula where I’ve also added a third argument that specifies the column number from which the value should be fetched.

To make this formula dynamic, I have used the COLUMNS function that would keep on changing the column value from 1 to 2 to 3 as you copy it to the right.

Once done, you can convert the formulas to values to make sure that you have a static result.

Note: When you use a formula to reverse the order of a data set in Excel, it would not retain the original formatting. If you need the original formatting on the sorted data as well, you can either apply it manually or copy and paste the formatting from the original data set to the new sorted dataset

Flip Data Using VBA

If flipping the data in Excel is something you have to do quite often, you can also try the VBA method.

With a VBA macro code, you can copy and paste it once within the workbook in the VBA editor, and then reuse it over and over again in the same workbook.

You can also save the code in the Personal Macro Workbook or as an Excel add-in and be able to use it in any workbook on your system.

Below is the VBA code that would flip the selected data vertically in the worksheet.

Sub FlipVerically()

'Code by Sumit Bansal from TrumpExcel.com

Dim TopRow As Variant
Dim LastRow As Variant
Dim StartNum As Integer
Dim EndNum As Integer

Application.ScreenUpdating = False

StartNum = 1
EndNum = Selection.Rows.Count

Do While StartNum < EndNum
TopRow = Selection.Rows(StartNum)
LastRow = Selection.Rows(EndNum)
Selection.Rows(EndNum) = TopRow
Selection.Rows(StartNum) = LastRowStartNum = StartNum + 1
EndNum = EndNum - 1
Loop

Application.ScreenUpdating = True
End Sub

To use this code, you first need to make the selection of the data set that you want to reverse (excluding the headers), and then run this code.

How does this code work?

The above code first counts the total number of rows in the data set and assigns that to the variable EndNum.

It then uses the Do While loop where the sorting of the data happens.

The way it sorts this data is by taking the first and the last row and swapping these. It then moves to the 2nd row in the second last row and then swaps these. Then it moves to the third row in the third last row and so on.

The loop ends when all the sorting is done.

It also uses the Application.ScreenUpdating property and sets it to FALSE while running the code, and then turn it back to TRUE when the code has completed running.

This ensures that you don’t see the changes happening in real-time on your screen it also speeds up the process.

How to use the Code?

Follow the below steps to copy and paste this code in the VB Editor:

  1. Open the Excel file where you want to add the VBA code
  2. Hold the ALT key and press the F-11 key (you can also go to the Developer tab and click on the Visual Basic icon)
  3. In the Visual Basic Editor that opens up, there would be a Project Explorer on the left part of the VBA editor. If you don’t see it, click on the ‘View’ tab and then click on ‘Project Explorer’Project Explorer
  4. Right-click on any of the objects for the workbook in which you want to add the code
  5. Go to the Insert option and then click on Module. This will add a new module to the workbookInsert a module
  6. Double-click on the module icon in the Project Explorer. This will open the code window for that module
  7. Copy and paste the above VBA code into the code windowCopy paste the VBA code

To run the VBA macro code, first select the dataset that you want to flip (excluding the headers).

With the data selected, go to the VB Editor and click on the green play button in the toolbar, or select any line in the code and then hit the F5 key

Click the Macro run button

So these are some of the methods you can use to flip the data in Excel (i.e., reverse the order of the data set).

All the methods that I have covered in this tutorial (formulas, SORT feature, and VBA), can be used to flip the data vertically and horizontally (you’ll have to adjust the formula and VBA code accordingly for horizontal data flipping).

I hope you found this tutorial useful.

Other Excel tutorials you may also like:

  • How to Sort by the Last Name in Excel (Easy Guide)
  • How to Sort By Color in Excel (in less than 10 seconds)
  • How to Sort Worksheets in Excel using VBA (alphabetically)
  • How to do a Multiple Level Data Sorting in Excel

Reverse Order of Excel Data

The reverse order in Excel is flipping the data where the bottom value comes on top, and the top value goes to the bottom.

For example, look at the below image.

Reverse String Data

As we can see, the bottom value is at the top in the reverse order, and the same goes for the top value. So, how we reverse the order of data in Excel is the question now.

Table of Contents
  • Reverse Order of Excel Data
    • How to Reverse the Order of Data Rows in Excel?
      • Method #1 – Simple Sort Method
      • Method #2 – Using Excel Formula
      • Method #3 – Reverse Order by Using VBA Coding
    • Things to Remember
    • Recommended Articles

How to Reverse the Order of Data Rows in Excel?

In Excel, we can sort by following several methods. Here, we will show you all the possible ways to reverse the order in Excel.

You can download this Reverse Order Excel Template here – Reverse Order Excel Template

Method #1 – Simple Sort Method

You must already wonder whether it is possible to reverse the data by just using a sort option. Unfortunately, we cannot reverse just by sorting the data, but we can do this with some helper columns.

We must follow the below-given steps to reverse the order of data rows in Excel.

  1. We must first consider the below data for this example.

    Excel Reverse Order Example 1.1

  2. Next, we must create a Helper column and insert serial numbers.

    Excel Reverse Order Example 1.2

  3. Now, select the entire data and open the sort option by pressing ALT + D + S.

    Excel Reverse Order Example 1.3

  4. Under Sort by, choose Helper.

    Excel Reverse Order Example 1.4

  5. Then, under Order, choose Largest to Smallest.

    Excel Reverse Order Example 1.5

  6. Now click on OK, and it will reverse our data.

    Excel Reverse Order Example 1.6

Method #2 – Using Excel Formula

We can also reverse the order by using formulas. So, even though we do not have any built-in function to do this, we can use other formulas to reverse the order.

To make the reverse order of data, we can use two formulas: INDEX and ROWS. The INDEX FunctionThe INDEX function in Excel helps extract the value of a cell, which is within a specified array (range) and, at the intersection of the stated row and column numbers.read more can fetch the result from the mentioned row number of the selected range. The ROWS function in excelThe ROWS function in Excel returns the number of rows selected in the range.  It’s not the same as the ROW function. read more can give the count of several selected rows.

Step 1 – First, we must consider the below data for this example.

Excel Reverse Order Example 2.1

Step 2 – Then, we must open the INDEX function first.

Excel Reverse Order Example 2.2

Step 3 – For “Array,” we must select the city names from A2: A9 and make it an absolute reference by pressing the “F4” key.

Using Excel Formula Example 2.3

Step 4 – To insert RowNum, we must open the ROWS function inside the INDEX function.

Using Excel Formula Example 2.4

Step 5 – For the ROWS function, we must select the same range of cells as we have selected for the INDEX function. But this time, it only makes the last cell an absolute reference.Absolute reference in excel is a type of cell reference in which the cells being referred to do not change, as they did in relative reference. By pressing f4, we can create a formula for absolute referencing.read more

Using Excel Formula Example 2.5

Step 6 – Now, close the bracket and press the “Enter” key to get the result.

Using Excel Formula Example 2.6

Step 7 – Drag the formula to get the full result.

Using Excel Formula

Method #3 – Reverse Order by Using VBA Coding

Reversing the order of excel data is also possible by using VBA CodingVBA code refers to a set of instructions written by the user in the Visual Basic Applications programming language on a Visual Basic Editor (VBE) to perform a specific task.read more. If you have good knowledge of VBA, then below is your code.

Code:

Sub Reverse_Order()

    Dim k As Long
    Dim LR As Long

    LR = Cells(Rows.Count, 1).End(xlUp).Row

    For k = 2 To LR
        Cells(k, 2).Value = Cells(LR, 1).Value
        LR = LR - 1
    Next k

End Sub

We need to copy this code to the module.

Using VBA Code Example 3.1

Now, run the code to get the reverse order list in the Excel worksheet.

Let us explain how this code works. First, we have declared two variables, “k” & “LR, as a “LONG” data type.

Dim k As Long
Dim LR As Long

“k” is for looping through cells, and “LR” is to find the last used row in the worksheet.

Next, we have used the last used row technique to find the last value in the string.

LR = Cells(Rows.Count, 1).End(xlUp).Row

Next, we have employed FOR NEXT loop-to-loop through the cells to reverse the order.

For k = 2 To LR
    Cells(k, 2).Value = Cells(LR, 1).Value
    LR = LR - 1
Next k

So when we run this code, we get the following result.

Using VBA Code

Things to Remember

  • There is no built-in function or tool available in Excel to reverse the order.
  • A combination of INDEX + ROWS will reverse the order.
  • The “Sort” option is better and easier to sort from all the available techniques.
  • To understand VBA code, we need to know VBA macros.

Recommended Articles

This article is a guide to Excel Reverse Order. Here, we discuss how to reverse the order of data using 1) Sort Method, 2) Excel Formula 3) VBA Code. You can learn more from the following articles: –

  • VBA XLUP
  • Make Box and Whisker Plot in Excel
  • VBA Macros
  • How to Shade Alternate Excel Rows?

На чтение 4 мин Просмотров 1к. Опубликовано 27.04.2022

Бывают ситуации, когда вам нужно «перевернуть» вашу табличку. То есть сделать так, чтобы данные, которые находятся вверху — были внизу.

И да, это удивительно, но в программе нет специальной функции для этого.

Конечно же, мы можем сделать это сразу несколькими методами. Но именно своей функции для такой задачи в Excel нет.

Итак, начнём!

Содержание

  1. С помощью функции «Сортировка»
  2. По вертикали
  3. По горизонтали
  4. C помощью СОРТПО и ИНДЕКС
  5. С помощью СОРТПО
  6. С помощью ИНДЕКС
  7. С помощью Visual Basic

С помощью функции «Сортировка»

Это, наверное, самый быстрый и удобный метод.

По вертикали

Допустим, нам нужно отсортировать данные в обратном порядке, для следующей таблички:

Пошаговая инструкция:

  • Создайте столбик для расчетов (мы назовем его «Helper»);

  • Выделите табличку и щелкните на «Данные»;

  • Далее — «Сортировка»;

  • В первом параметре сортировки выберите наш столбик для расчетов;

  • А в третьем — «По убыванию»;

  • Подтвердите.

Готово! Вот результат:

После сортировки можно удалить столбик для расчетов.

Мы рассмотрели табличку, в которой есть только один столбик с данными(не считая имен). Но его можно использовать независимо от того, сколько у вас столбиков с данными.

По горизонтали

Практически тоже самое с табличками по горизонтали.

Итак, давайте рассмотрим такой пример.

Допустим, у нас есть такая табличка:

Пошаговая инструкция:

  • Создаем столбик для расчетов, только теперь это не столбик, а строка. Так как табличка у нас горизонтальная;

  • Открываем «Сортировка»;
  • Жмем «Параметры…»;

  • И выберите «Столбцы диапазона»;

  • Подтвердите;
  • В первом параметре выберите ту строку, которая является строкой для расчетов.

  • В третьем параметре — «По убыванию»;

  • Подтвердите.

Готово! Вот результат:

После сортировки можете смело удалять строку для расчетов.

C помощью СОРТПО и ИНДЕКС

Функция ИНДЕКС доступна для всех, а вот функция СОРТПО доступна только по платной подписке Office 365.

С помощью СОРТПО

Допустим, у нас есть такая табличка:

Создадим еще два столбика, с теме же заголовками. Там будет наша обработанная табличка.

Формула функции примет такой вид:

=СОРТПО($A$2:$B$12;СТРОКА(A2:A12);-1)

Сортировка происходит по данным, полученным из функции СТРОКА.

Она создает массив с порядковыми номерами строк.

А последний аргумент в функции (“-1”) говорит Excel о том, что нам нужен порядок «По убыванию».

Вот, собственно, и все!

С помощью ИНДЕКС

Мало кто пользуется Microsoft 365 и платит за подписку, но не переживайте, если вы из таких людей, то для вас есть выход!

Допустим, у нас та же табличка:

Формула примет такой вид:

=ИНДЕКС($A$2:$A$12;СТРОКА(A2:$A$12))

Что мы сделали?

Функция СТРОКА, в результате выполнения, отдает нам кол-во строчек в диапазоне ячеек.

И этот результат будет становиться меньше и меньше.

А ИНДЕКС, по номеру строки, отдает нам значение этой строки. Таким образом мы получаем порядок «По убыванию».

Так же, как и в предыдущих методах, функцию можно использовать в табличке с несколькими столбиками данных. Но, в аргументе, вам нужно будет указать, откуда функции брать данные для обработки.

Допустим, у вас есть такая табличка:

Формула примет такой вид:

=ИНДЕКС($A$2:$B$12;СТРОКА(A2:$A$12);СТОЛБЕЦ($A$2:A2))

Все также, только мы дополнительно указали столбик, откуда функция ИНДЕКС должна брать данные и помещать в новые ячейки.

Если вы решили отсортировать данные — помните, что отменить сортировку у вас не получится. Если исходная сортировка для вас важна, то сделайте копию оригинальной таблички.

С помощью Visual Basic

И, как обычно, рассмотрим метод с Visual Basic.

Это решение отлично подойдет для тех, кто использует такую сортировку очень часто.

Вот нужный нам код Visual Basic:

Sub FlipVerically()     

Dim TopRow As Variant 
Dim LastRow As Variant 
Dim StartNum As Integer 
Dim EndNum As Integer   

Application.ScreenUpdating = False   

StartNum = 1 
EndNum = Selection.Rows.Count   

Do While StartNum < EndNum 
TopRow = Selection.Rows(StartNum) 
LastRow = Selection.Rows(EndNum) 
Selection.Rows(EndNum) = TopRow 
Selection.Rows(StartNum) = LastRow 
StartNum = StartNum + 1 
EndNum = EndNum - 1 
Loop   

Application.ScreenUpdating = True 
End Sub

Очень важно, если вы хотите использовать функцию, которую мы создали с помощью этого кода — не выделяйте заголовки таблички.

Куда нужно поместить код?

Пошаговая инструкция:

  • ALT + F11;

  • Правой кнопкой мышки на любой лист -> «Insert» -> «Module»;

  • В открывшееся окошко вставьте наш код и закройте Visual Basic;

А дальше, чтобы использовать функцию — выделите табличку и нажмите «Run Macro» (или F5).

В этой статье, я рассказал вам о том, как можно отсортировать данные в обратном порядке. Мы рассмотрели как сделать это с помощью встроенной функции “Сортировка”, с помощью СОРТПО и ИНДЕКС, а также Visual Basic.

Надеюсь, эта статья оказалась полезна для вас!

See all How-To Articles

In this tutorial, you will learn how to reverse the order of data in Excel and Google Sheets.

reverse the order of data formula final

Reverse the Order of Data

Use Helper Column and Sort

There are several ways to reverse the order of data (flip it “upside down”) in Excel. The following example uses a helper column that will then be sorted. Say you have the list of names below in Column B and want to sort it in reverse order.

reverse the order of data initial data

  1. In Column C, add serial numbers next to the names in Column B. Start at 1 and increase by 1 for each name. Column C is the helper column you’ll use to sort the data in reverse order by going from ascending to descending.

reverse the order of data 1

  1. Select the entire data range (B1:B9), and in the Ribbon, go to Data > Sort.

reverse the order of data 2

  1. In the Sort window, (1) select Order for Sort by, (2) Largest to Smallest for Order, and (3) click OK.

reverse the order of data 3

As a result, the data range is sorted in a descending order by Column C, which means that names in Column B are now in the reverse order. You can delete the helper column now.

reverse the order of data final data

Reverse Order With a Formula

Another way to reverse the data order is to use the INDEX and ROWS Functions.

  1. Enter the following formula in cell C2:
=INDEX($B$2:$B$9,ROWS(B2:$B$9))

Let’s walk through how this formula works:

    • The INDEX Function takes a data range (the first parameter) and a row (the second parameter) and returns a value. In this case, the range is always B2:B9, and the row is the output of the ROWS Function.
    • The ROWS Function in this example returns the number of rows in the selected range, which starts at the current row and ends at the last cell.

So for cell C2, the result of the ROWS Function is 8 (There are eight rows from B2 through B9.), so the INDEX Function will return the value in the eigth row of the data range, which is Luke. For cell C3, the result of the ROWS Function is 7 (There are seven rows from B3 through B9.), so the INDEX Function returns Travor. In this way, the row for the INDEX Function will decrease by one each time and form the original list in reverse order.

reverse the order of data formula

  1. Position the cursor in the bottom right corner of cell C2 until the cross appears, then drag it down through Row 9.

reverse the order of data formula 1

The final result is the data set from Column B sorted in reverse order in Column C.

reverse the order of data formula final

Reverse Data Order in Google Sheets

In Google Sheets, you can use the INDEX and ROWS formula exactly the same as in Excel. But the helper column method works a bit differently

  1. Select the entire data range, including the helper column (B1:C9) and in the Menu, go to Data > Sort range.

google sheets reverse the order 1

  1. In the Sort window, (1) check Data has header row, (2) choose Order for Sort by, (3) select Z → A (descending), and (4) click Sort.

google sheets reverse the order 2

As a result, the names are now in the reverse order in Column C.

google sheets reverse the order 3

This article teaches you how to reverse the order of a list in Excel. For example, we want to reverse the list in column A below.

1. Enter the value 1 into cell B1 and the value 2 into cell B2.

2. Select the range B1:B2, click the lower right corner of this range, and drag it down to cell B8.

Add List

3. Click any number in the list in column B.

4. To sort in descending order, on the Data tab, in the Sort & Filter group, click ZA.

Sort in Descending Order

Result. Not only the list in column B, but also the list in column A has been reversed.

Reversed List in Excel

If you have Excel 365 or Excel 2021, use SEQUENCE, SORTBY and ROWS to sort a list in reverse order. The following formula is pretty awesome.

5. First, use the SEQUENCE function to generate a list of numbers. The SEQUENCE function below has 4 arguments. Rows = 8, Columns = 1, Start = 1, Step = 1.

SEQUENCE function

Note: the SEQUENCE function, entered into cell B1, fills multiple cells. Wow! This behavior in Excel 365/2021 is called spilling.

6. The SORTBY function sorts a range based on the values in a corresponding range. Use -1 (third argument) to sort in descending order.

SORTBY function

7. Nest the SEQUENCE function inside the SORTBY function.

SORTBY and SEQUENCE

8. If you have a longer list of say 20 names, change the value 8 to 20 in the formula shown above, or even better, use the ROWS function.

Reverse Order in Excel

Note: the ROWS function simply counts the number of rows in a range.

There is no built in function to reverse a list of data in Excel. But this can be done in a few simple steps:

  1. In an empty column, put in the number 1 for the first
  2. Drag 1 down to create a list of numbers in increasing order (press Cntrl and drag down)
  3. Turn on the auto filter for the list of data to be reversed
  4. Select “Sort by Descending” on the column of numbers (Column B in this example)

  5. Turn off auto filter
  6. Delete the column of descending numbers

  5 people found this article useful

  5 people found this article useful

Понравилась статья? Поделить с друзьями:
  • Reverse find in excel
  • Reverse each word in a string
  • Reverse column in excel
  • Reverse bits in word
  • Returns in excel cell