Cellwise Start free

Excel guide · 4 min read

How to reverse the order of a list in Excel

Quick answerIn Excel 365 or 2021, =SORTBY(B2:B8,ROW(B2:B8),-1) returns the list bottom to top and updates when the list changes. In older versions, put =INDEX($B$2:$B$8,COUNTA($B$2:$B$8)-ROW(A1)+1) in the first cell and fill down. To flip the data itself, add a helper column numbered 1, 2, 3 and sort it Largest to Smallest.

Sample data

Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.

ABCDEFGHI
1DateEventStatusMonTueWedThuFri
2Oct 26, 2026Order placedDone
3Oct 26, 2026Payment clearedDone
4Oct 27, 2026PackedDone
5Oct 28, 2026ShippedDone
6Oct 30, 2026Customs holdDelayed
7Nov 2, 2026Out for deliveryDone
8Nov 2, 2026DeliveredDone

Download this sheet as an Excel practice file (.xlsx)

Why Sort Z to A does not reverse a list

The tracking log lists parcel events oldest first, and you want the newest at the top. The first instinct is Sort Z to A, or =SORT(B2:B8,,-1). That sorts the text alphabetically, backwards. It does not flip the order of the rows, so Shipped jumps to the top and Delivered ends up near the bottom.

Reversing means sorting by position: the last row first, the first row last. Every method below does that by giving each row its row number and sorting those numbers from largest to smallest.

=SORT(B2:B8,,-1)

Result: spills 7 rows × 1 column

Shipped
Payment cleared
Packed
Out for delivery
Order placed
Delivered
Customs hold

Shipped, Payment cleared, Packed, Out for delivery, Order placed, Delivered, Customs hold. Alphabetical Z to A, not the reversed list.

Method 1: SORTBY with ROW or SEQUENCE (Excel 365 / 2021)

SORTBY sorts one range by another. ROW(B2:B8) gives each row its row number, 2 to 8, and -1 sorts those descending, so the bottom row comes first. The result spills down from the formula cell and updates when you edit an event.

=SORTBY(B2:B8,SEQUENCE(ROWS(B2:B8)),-1) does the same job with the numbers 1 to 7 instead of 2 to 8. Use whichever reads better to you. To flip the whole table and keep each row together, give SORTBY all three columns: =SORTBY(A2:C8,ROW(A2:A8),-1).

=SORTBY(B2:B8,ROW(B2:B8),-1)

Result: spills 7 rows × 1 column

Delivered
Out for delivery
Customs hold
Shipped
Packed
Payment cleared
Order placed

Delivered, Out for delivery, Customs hold, Shipped, Packed, Payment cleared, Order placed. The exact reverse of the log.

Gotcha: sorting by date newest first is not the same thing

It seems equivalent to sort the log by date, newest first. It is not when two events share a date. Excel keeps tied rows in their original order, so on November 2, Out for delivery stays above Delivered and the newest event is in second place.

If the log is already in time order, reverse it by position with ROW. If it is not, sort by date and time together, which needs the time in the data.

=SORTBY(A2:C8,A2:A8,-1)

Result: spills 7 rows × 3 columns

46328Out for deliveryDone
46328DeliveredDone
46325Customs holdDelayed
46323ShippedDone
46322PackedDone
46321Order placedDone
46321Payment clearedDone

The first row is November 2, Out for delivery, followed by Delivered. Reversing by ROW puts Delivered first.

Method 2: INDEX with COUNTA (every version)

Without SORTBY, use one formula per row. In the first cell of the new list, =INDEX($B$2:$B$8,COUNTA($B$2:$B$8)-ROW(A1)+1). COUNTA counts the 7 events, ROW(A1) is 1 in the first cell, so INDEX returns item 7, the last one. Fill down and ROW(A1) becomes ROW(A2), ROW(A3) and so on, counting backwards through the list.

The ROW(A1) part must stay relative and the list range absolute, or the formula breaks as you fill it. Two catches: COUNTA counts only filled cells, so a blank cell in the middle of the list makes the count too small and the bottom item never appears; and filling past the end returns wrong values. Guard the extra rows with an IF so they stay blank: =IF(ROW(A1)>COUNTA($B$2:$B$8),"",INDEX($B$2:$B$8,COUNTA($B$2:$B$8)-ROW(A1)+1)).

=INDEX($B$2:$B$8,COUNTA($B$2:$B$8)-ROW(A1)+1)

Result: Delivered

Delivered, the last event. Filled down seven rows, the column ends with Order placed.

Method 3: a helper column and Sort (no formulas left behind)

Use this when you want the data itself flipped, for example before pasting it somewhere else.

  1. Insert an empty column next to the list and type 1 and 2 in its first two cells.
  2. Select both cells and double-click the fill handle to number every row down to the end of the data.
  3. Click any number in the helper column, then Data > Sort Largest to Smallest (Z→A). Excel expands the selection to the neighbouring columns, so each row moves as a whole.
  4. Delete the helper column.

Reverse a row left to right

The same idea works across a row: sort by COLUMN instead of ROW. In Excel 365 or 2024, =CHOOSEROWS(B2:B8,SEQUENCE(ROWS(B2:B8),,-1,-1)) is another way to reverse a column, because negative numbers count from the end. The Sort dialog can also sort left to right under Options, with a helper row of numbers.

=SORTBY(E1:I1,COLUMN(E1:I1),-1)

Result: spills 1 row × 5 columns

FriThuWedTueMon

Fri, Thu, Wed, Tue, Mon across five cells.

Which method to pick

SORTBY with ROW for a reversed copy that stays live in Excel 365 or 2021. INDEX with COUNTA when the file must work in Excel 2019 or older. The helper column when you want to flip the original data in place and keep no formulas. Either way, never use Sort Z to A to reverse a list.

Common mistakes

Using Sort Z to A or SORT with -1

That sorts the values alphabetically. To reverse, sort by row number: SORTBY(range,ROW(range),-1).

Sorting only the helper column

If you select just the helper column and choose Continue with the current selection, the numbers move and the data does not. Let Excel expand the selection.

Blank cells in the list with the COUNTA formula

COUNTA skips blanks, so the count is too small and the reversed list leaves out the bottom items. Use ROWS($B$2:$B$8) instead of COUNTA when the range has a fixed size.

Sorting a table by date to "reverse" it

Rows with the same date keep their original order. Reverse by position with ROW if the log is already chronological.

FAQ

How do I flip a column upside down in Excel?

In Excel 365 or 2021 use =SORTBY(A2:A20,ROW(A2:A20),-1). Without formulas, add a helper column numbered 1 to n and sort it Largest to Smallest with the data.

Is there a reverse function in Excel?

There is no REVERSE function. SORTBY with ROW, or CHOOSEROWS with negative positions in Excel 365 and 2024, give the same result in one formula.

How do I reverse the order of rows but keep each row together?

Give SORTBY the whole table: =SORTBY(A2:C8,ROW(A2:A8),-1). With the helper column method, let Excel expand the selection so every column moves.

Why does my reversed list show #SPILL!?

SORTBY needs empty cells below it for the whole list. Clear whatever is in the way, or move the formula to an empty area. It also cannot spill inside an Excel table.

Functions used

Related guides

Updated