56 free macros indexedAll toolsHow to runBlogGitHub ↗

How to Reverse the Order of Rows in Excel

To reverse the order of rows in Excel, use a helper column and sort, the SORTBY formula, or a free one-click macro that flips rows in place.

2026-07-02

Three ways to reverse the order of rows in Excel

Excel has no built-in "reverse rows" button, so to reverse the order of rows in Excel you add a helper column and sort, use the SORTBY formula, or run a free macro that flips rows in place. Which one fits depends on your Excel version and whether you need the result to stay live.

TL;DR: Key takeaways

  • The helper column method works in every version: number the rows, sort largest to smallest.
  • SORTBY (=SORTBY(range, ROW(range), -1)) flips rows live on Excel 365 and 2021 without touching the source.
  • A free macro reverses the selection in place in one click, no helper column needed.
  • Select only the data rows. Include the header and it flips to the bottom too.

Method 1: Helper column and sort (works everywhere)

  1. In a blank column next to your data, type 1, 2, 3 down the rows.
  2. Select your data including the helper column.
  3. Data > Sort, sort by the helper column, Largest to Smallest.
  4. Delete the helper column.

Runs in every Excel version, per Microsoft's sort dialog guide. The tradeoff is four steps for something you might repeat monthly.

Method 2: SORTBY (Excel 365 and 2021)

=SORTBY(A2:C20, ROW(A2:A20), -1)

Spills a reversed copy into a new spot, updates live when the source changes, and leaves the original untouched. Needs Excel 365 or 2021, and the output is a formula; paste as values to freeze it.

Method 3: The free macro

Download Reverse Row Order. Free .xlsm, runs offline.

  1. Select the data rows to flip, every column, header excluded.
  2. Alt + F8, pick ReverseRowOrder, click Run.
  3. The macro reverses top to bottom in place and reports how many rows it flipped.

It writes plain values, so any formulas in the selection become their results after flipping, if you need the flip to stay live, use SORTBY instead. It also moves values into existing cells rather than moving formatting, so a color-coded row keeps its color even though a different record now sits there. Reapply formatting after, or flip before you style.

A real example

A bookkeeper at a courier firm exports a 1,500-row transaction log every month, oldest-first, but the review reads better with the newest entries on top. A plain date sort makes it worse, since several rows share a timestamp and sorting reshuffles their order. Selecting the 1,500 data rows and running the macro flips the whole block in about three seconds: newest on top, tied rows keep their original relative order, and every column stays aligned.

Frequently asked questions

How do I reverse the order of rows in Excel without a helper column?

Run the free macro, or use SORTBY on Excel 365. The macro flips the selection in place in one click; SORTBY spills a live reversed copy elsewhere without changing the original.

Does reversing rows keep my columns aligned?

Yes. The macro reverses whole rows, moving every column in the selection together, so each record stays intact. Leave the header row out of the selection.

Can I reverse a single column instead of whole rows?

Yes. Select just that column and run the macro; it reverses the values top to bottom within whatever you select.

Does this work in Excel for the web or on Mac?

The macro runs on Windows and Mac, 2016 and later, not on Excel for the web, which has no VBA. Use SORTBY or the helper-column sort there instead.

Will it work if my selection includes formulas?

It runs, but every formula in the selection is replaced by its current result before the rows flip. There's no formula left afterward, just the value it displayed at that moment. If you need the flip itself to stay live as a formula, use SORTBY instead.

What to do next

Helper column for any Excel version, SORTBY for a live flip on 365, the macro when you just want it flipped right now. For related layout jobs, transpose rows and columns rotates data instead of flipping it, and swap two columns handles left-to-right moves.