To flip rows in Excel while keeping each record together, add a helper column numbered from top to bottom, select the entire data range, and sort the helper column from largest to smallest. If you have Microsoft 365 or Excel 2021 or later, you can also use a formula to display a reversed copy without changing the source data. Make a copy first if the original order matters.
What You’ll Need
- An Excel worksheet with the rows you want to reverse.
- A clear idea of whether the header row should stay at the top. Usually, it should.
- A spare column for the helper-number method, or a blank area for the formula method.
- Optional: a backup copy of the workbook, especially if you plan to sort the original data.
Step-by-Step
- Identify the full data range. Include every column that belongs to each record, not just the column you are looking at. For example, a list with names, dates, and amounts must be reversed as one complete block so each name stays paired with its date and amount. Note the header row, if there is one. The instructions below assume headers are in row 1 and records begin in row 2, but the same method works with other row numbers.
- Make a working copy if needed. Sorting changes the order of the source rows. If you need to preserve the current sequence, copy the worksheet by right-clicking its sheet tab and choosing Move or Copy, then select Create a copy. You can also copy the data to another sheet. The formula option later in this guide leaves the source range in place.
- Add a helper column next to the records. Insert or use a blank column beside the data, and give its header a clear name such as Original order. Keep the helper column within the block you will sort. If the data is an Excel table, add a column to the table so that the helper values are part of the same records.
- Number the records from top to bottom. Enter 1 beside the first record and 2 beside the second. Select both numbers, then drag the fill handle—the small square at the lower-right corner of the selection—down to the last record. Excel should continue the series. Check the final few values to confirm the numbering increased by one each row. If dragging copies the same number, use the fill options or enter the sequence in a way that creates a series rather than a copy.
- Select the complete range, including the helper column. Include all record columns and the helper values. Do not select only the helper column: that would reorder the numbers without moving the corresponding records. If you use a filter, clear it first if you need to reverse every record, and unhide any rows you expect to include.
- Open the Sort dialog. On Windows, go to Data > Sort. If Excel asks whether to expand the selection, choose Expand the selection. In the Sort dialog, make sure My data has headers is selected if your range includes a header row. This keeps the header out of the sort.
- Sort by the helper column in descending order. In Sort by, choose the helper-column header. Set Sort On to Cell Values and Order to Largest to Smallest, then select OK. The record that was last will move to the top, followed by the second-to-last record, and so on. The header remains at the top when Excel recognizes it as a header.
- Check the result and remove the helper column if appropriate. Confirm that the last original record is now first and that the values in every row still belong together. You can then delete the helper column, or keep it if you might want to restore the original order later. If you kept it, sorting by that column from smallest to largest restores the starting sequence.
Formula alternative for Microsoft 365 or Excel 2021 and later: This returns a reversed copy in a separate area, leaving the source rows untouched. For this example, assume headers are in A1:C1 and the data to reverse is in A2:C5; put the formula in an empty cell such as E2, with enough blank space below and to the right for the results to spill. Enter =SORTBY(A2:C5,ROW(A2:A5),-1). The result contains the original rows in the order 5, 4, 3, 2. Keep the headers separately above the output if you want them displayed. To use a different range, replace both source references so they cover the same number of rows. The formula works in Microsoft 365 and Excel 2021 or later; it is also available in those versions on Mac and Excel for the web.
Common Mistakes
- Sorting just one column. This disconnects values from the rest of their record. Always include the entire data range, including the helper column, and choose Expand the selection if Excel offers it.
- Including the header as a record. If Excel sorts the header along with the data, it may appear in the middle of the list. Confirm My data has headers in the Sort dialog and check that the selected range starts with the header row.
- Choosing the wrong sort direction. A helper sequence that runs from 1 upward must be sorted from Largest to Smallest to reverse the rows. Smallest to Largest simply recreates the original order.
- Leaving out columns or rows. If a related column sits outside the selected block, it will not move with the records. Check for notes, totals, or other fields beside the main table before sorting. Do not include a separate totals row as if it were a regular record.
- Using a formula where the results cannot spill. The formula method needs an empty output area. Existing values, merged cells, or other obstructions can cause a spill error. Clear a suitable rectangle or choose a different starting cell.
- Assuming a sort is easy to undo later. You can often use Undo immediately after a sort, but later edits may make that impractical. Keep the helper sequence until you have checked the result, or work on a copy.
Tips
- Use a helper column when you need to reverse the original worksheet. It works in many Excel versions and makes the order explicit. Keeping the sequence values lets you switch back to the original order without guessing.
- Use the formula when you want a live, separate view. The formula output updates when source values change, but it does not rearrange the source cells. Do not type into the spill area; make changes in the source range instead.
- Keep the header out of the sequence. Number only the data records. For a range starting in row 2, the first record gets 1 even though it is on worksheet row 2.
- Consider whether chronological order is actually what you need. Reversing rows follows their current top-to-bottom sequence. It does not sort dates or names independently. If the source is not already in the intended order, sort it into that order first, then reverse it.
- For repeatable work, label the helper clearly. A heading such as Original order helps distinguish the numbering from business data. When finished, remove that column only after confirming you no longer need it to restore the sequence.
- Undo with the platform’s standard shortcut if you make an immediate mistake. On Windows, press Ctrl+Z; on Mac, press Command+Z. Undo may no longer restore the original state after further workbook actions, so a backup is the safer safeguard.
Troubleshooting
The rows did not reverse. Check that the helper values run upward from top to bottom and that the sort order was Largest to Smallest. If the helper values are stored as text, Excel may sort them alphabetically—for example, placing 9 after 10. Re-enter them as numbers, or select the cells and use an appropriate number format and numeric values before sorting.
Only one column moved. Undo immediately with Ctrl+Z on Windows or Command+Z on Mac, if available. Run the sort again and include the whole record range. If Excel asks whether to expand the selection, choose that option. For a table, verify that the relevant fields are all inside the table.
The header moved or was sorted into the list. Undo the sort, select the range again, and check My data has headers in Data > Sort. If the header is not part of the selected range, select the data and header together before opening the dialog, then mark the header setting.
The formula displays an error or does not appear. Make sure you are using Microsoft 365 or Excel 2021 or later, and check that the output area is empty and not inside a merged cell. If Excel shows #SPILL!, remove anything blocking the spill range. If it shows #NAME?, your Excel version may not support SORTBY; use the helper-column method instead. In Excel for the web, confirm you are editing the workbook rather than viewing it in read-only mode.
The order is reversed but some rows are missing. Recheck the source selection for blank rows, filtered-out records, and data below or beside the main block. Clear filters and unhide rows if you want every record considered, then repeat the sort on the full range. If the result still seems incomplete, compare the number of source records with the number of rows in the reversed result.
Frequently Asked Questions
Can I reverse rows without changing the original data?
Yes. Use the SORTBY formula in a blank area to create a reversed copy. The source stays in its original order, while the output updates when source values change. If your Excel version does not support SORTBY, copy the data to another sheet and use the helper-column sort there.
Does sorting by a helper column reverse every column together?
It does if you sort the entire data range, including the helper column. Excel moves each row as a unit. If you select only the helper values or a single data column, related information can become misaligned, so verify the selection before confirming the sort.
Will the method keep my header at the top?
Yes, provided the header is included in the selected range and Excel is told that the range has headers. In the Sort dialog, select My data has headers. The formula alternative does not include a header unless you put one in the output area yourself.
Can I reverse rows in an Excel table?
Yes. Add the helper column to the table, number its records from top to bottom, and sort that column from largest to smallest. Sorting a table column reorders whole table records. For the formula method, use a range reference that covers the table’s data rows and place the results outside the table.
Can I reverse columns instead of rows?
The helper-column method is designed to reorder records vertically. To reverse columns, create a helper row with a sequence across the columns and sort left to right using Excel’s orientation setting in the Sort dialog. Be especially careful to include all rows that belong together and preserve any header or label columns.
Does this work in Excel for Mac or Excel for the web?
The helper-column approach and the Data sort tools are available in current Excel for Mac and Excel for the web, although button placement can differ slightly. The formula approach requires a version that supports SORTBY, such as Microsoft 365 or Excel 2021 and later. On Mac, use Command+Z rather than Ctrl+Z to undo.
Related
- Inventory Spreadsheet App: How to Choose and Use One
- How to Insert a Table of Contents in Microsoft Word
- Inserting Citations in Word: A Step-by-Step Guide
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Add Just a Header in WordTo add only a header in Word, open the document and choose Insert > Header > Edit Header,…
- Google Sheets ARRAYFORMULA: How It Works and When to Use ItIn Google Sheets, ARRAYFORMULA lets one formula calculate across a range and return results into multiple cells. With…
- How to Make a Flowchart in Word 365: Step-by-Step GuideTo make a flowchart in Word 365, choose Insert > SmartArt > Process for a quick linear diagram,…
- Making Labels in Microsoft Word: A Practical GuideTo make labels in Microsoft Word, open Mailings > Labels, enter the label text, choose the label maker…
- Outlook Online Sweep Rules: How to Create and ManageTo create a Sweep rule in Outlook Online, select a message from the sender you want to manage,…
- Creating a Fillable Form in Word: Steps and Tips That WorkTo create a fillable form in Microsoft Word for Microsoft 365 on Windows, turn on the Developer tab,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.