To flip data order in Excel, add a temporary numbered helper column, sort the entire data range from largest to smallest, and then remove the helper column. This reverses the row order while keeping each record’s values together. If you want a formula-based result or need to reverse columns instead, use the options below.
Before changing the source data, save a copy or make sure you can undo the sort. Check that your data has a clear header row and that each record occupies one complete row; sorting only one column can separate values that belong together.
What You’ll Need
- An Excel worksheet with the rows or columns you want to reverse.
- A spare column for a temporary sort key when using the sort method. For a left-to-right column flip, you will need a spare row instead.
- Excel for Microsoft 365 on Windows for the formula method shown below. SORTBY is also available in Excel 2021; the helper-column method works in older desktop versions too.
- A saved copy of the workbook if the original order matters or the data is important.
Step-by-Step
- Identify what you want to reverse. The usual meaning of flipping data order is reversing rows from top to bottom: the last record becomes first, while the columns within each record stay in place. If you instead want the columns to run from right to left, use the separate column method in step 7. Decide whether the header should remain at the top. In most lists, keep the header fixed and reverse only the records beneath it.
- Check the range before sorting. Click inside the data and look across the first and last rows to confirm the records form one rectangular block. There should not be blank rows or columns splitting the list. If you have totals, notes, or a second table nearby, keep them outside the range. If the range is an Excel Table, sorting its records is supported; do not include unrelated worksheet cells in the selection.
- Insert a temporary helper column. Use the first empty column immediately next to the data, or another empty column you can include in the sort. Give its header a clear name such as Order. In the first record row, type 1; in the next record row, type 2. Select those two cells and drag the fill handle down to the final record, or use Home > Fill > Series to create an ascending sequence. Confirm the last record has the largest number. These numbers mark the original order; they are not values to keep in your final data.
- Select the complete range, including the helper column. Include the header row, every data row, every data column, and the temporary Order column. Selecting the entire block is essential: if you sort only the helper numbers or a single field, names, dates, and other values can become associated with the wrong record. If Excel prompts you to expand the selection, choose Expand the selection. In a Table, make sure the helper field is part of the table.
- Sort the helper values in descending order. On Windows, choose Data > Sort. In the Sort dialog, check My data has headers if the selected top row contains field names. Set Sort by to Order, Sort On to Values, and Order to Largest to Smallest, then select OK. Excel moves each whole row as a unit, putting the record with the highest helper number first and the record numbered 1 last. The original order is now reversed.
- Verify the result and remove the helper column. Compare a few distinctive records at the top and bottom with the original order. Check that every field still matches its record. If the order is correct, delete the temporary Order column from the table or worksheet. If it is wrong, immediately press Ctrl+Z on Windows or Command+Z on Mac to undo, then check the selected range and sort settings before trying again. Save the workbook when you are satisfied.
- Use a formula when you want a separate reversed copy. This option leaves the source data untouched and returns a reversed, spillable result. With the records in A2:C4 and no header included in that range, enter this in an empty cell outside the source data:
=SORTBY(A2:C4,ROW(A2:A4),-1). For example, if A2:C4 contains 1, Apples, 4; 2, Pears, 7; and 3, Plums, 2, the returned rows are 3, Plums, 2; 2, Pears, 7; and 1, Apples, 4. Put the header in a separate row above the formula output if you want one. Leave enough blank cells below and to the right for the results to spill. SORTBY and dynamic arrays are available in Microsoft 365 and Excel 2021; in older Excel versions, use the helper-column sort. - Reverse columns from left to right if that is your goal. Add a temporary numbered row above or below the columns you want to reorder, with 1 above the leftmost column, 2 above the next, and so on. Select the whole rectangular range, including the helper row and all rows of data. Choose Data > Sort, then select Options and choose Sort left to right. In the Sort dialog, choose the helper row under Sort by and set Order to Largest to Smallest. Select OK, verify that the column headers and their contents moved together, and remove the temporary helper row. This changes column order but does not reverse the order of rows within each column.
Common Mistakes
Sorting just one column: This is the most damaging error. If Excel sorts one field without its related fields, records are scrambled. Always include the full range, or choose Expand the selection when Excel asks. A quick check is to confirm the selection outline covers every field and every record before sorting.
Sorting the helper column the wrong way: Smallest to Largest preserves the original order if the helper numbers increase from top to bottom. Choose Largest to Smallest to reverse it. If your helper numbers were entered in descending order instead, the correct sort direction would be the opposite, so check both the sequence and the setting.
Including a total or unrelated data: A total row can move into the middle of a list if it is included with the records. Keep totals outside the sorted range, or use an Excel Table with totals handled separately. Likewise, do not select an entire worksheet just to reverse a small data block; other content may be affected.
Reversing the header by accident: The header normally stays at the top while records reverse underneath. Ensure My data has headers is checked for a range with a header row. When using the formula method, exclude the header from the source range and place a header separately above the spilled output.
Expecting a sort to keep itself updated: A helper-column sort changes the current arrangement; it does not automatically reverse new rows added later. The formula result can update when the referenced cells change, but its range must include the records you want to show.
Tips
Use the helper-column approach when you need to reverse the original list, want compatibility with older Excel versions, or need a result that can be copied and edited normally. Use SORTBY when you want a live reversed view and have a supported version. Keep the source and formula output in separate areas: a dynamic-array formula cannot spill into cells that are occupied by source data.
If you are working with a Table, add the Order field to the Table before sorting so the sort moves all fields together. Afterward, delete that Table column. For a plain range, placing the helper column directly beside the data makes it easier to select the correct block. If a sort dialog displays the wrong field names, cancel and reselect the range with its header row included.
For a particularly important workbook, duplicate the worksheet first by right-clicking its sheet tab and choosing Move or Copy, then selecting Create a copy. This gives you an easy way to compare the reversed list with the original. After sorting, verify a few complete records rather than checking only the first and last values; that helps catch a selection that omitted a column.
On Excel for Mac, the same basic helper-column process applies. Use the Data tab and its Sort command; dialog labels can vary slightly by release. For reversing columns, open the Sort dialog’s Options and choose the left-to-right orientation if it is available in your version. Excel for the web supports ordinary sorting, but its dialogs and feature availability may differ; if you cannot find the left-to-right option, open the workbook in the desktop app.
Troubleshooting
The rows did not reverse. Check that the helper numbers run from 1 at the top to the largest number at the bottom and that the sort order is Largest to Smallest. If they do and the list remains unchanged, confirm you sorted by the Order field rather than another column.
Values no longer match their original records. Undo immediately with Ctrl+Z on Windows or Command+Z on Mac. Repeat the sort and choose Expand the selection if prompted. If the prompt did not appear, select the complete data block manually before sorting. Do not try to repair a scrambled list by sorting individual columns one at a time.
The header was sorted into the records. Undo, select the complete range including its header, and check My data has headers in the Sort dialog. Alternatively, select only the data rows and sort by the helper values without including the header. Keep the header outside the formula range when using SORTBY.
The formula shows a spill error. Clear any cells blocking the expected output area, including spaces or merged cells, and make sure the formula is not inside an Excel Table. Dynamic-array formulas spill into ordinary worksheet cells, not into a table’s calculated column. If the function name is not recognized, check that your Excel version supports SORTBY or use the helper-column method.
The formula returns the wrong number of rows or columns. The data range and the ROW reference must cover the same number of rows. For example, if the data starts in row 2 and ends in row 20, the data range and row-number range should both end at row 20. Exclude blank rows if you do not want them included in the output.
The left-to-right option is missing. Make sure you opened the full Sort dialog and selected Options rather than using a quick sort button. If your Excel version or web interface does not offer Sort left to right, use a formula-based workaround only if your version supports the required functions, or open the workbook in desktop Excel.
Frequently Asked Questions
Can I reverse rows without changing the original data?
Yes. In Microsoft 365 or Excel 2021, enter SORTBY in a separate empty area and point it at the source range. The formula produces a reversed view while leaving the source cells in place.
Does sorting from Z to A flip the order?
Only when the field you sort by already represents the original sequence, such as sequential IDs that increase down the list. A text or date field sorts by its values, not necessarily by the rows’ previous positions. A temporary helper sequence gives you a dependable reverse.
Will this work if my data has filters?
It can, but clear or review filters first so you understand which records are visible. Sorting a filtered Table generally sorts the table records; hidden rows and filter criteria can make the displayed result seem incomplete. Confirm the full list after clearing the filter.
Can I flip data order with one click?
Excel does not have a universal Reverse Rows command on the ribbon. The helper-column sort is a reliable built-in method. You can also keep a SORTBY formula beside the original data if you regularly need a reversed view.
How do I restore the original order later?
If you have not saved or made other changes, use Undo immediately. Otherwise, keep an original copy or retain a sequence-number field that records the initial order. Sorting by that field from smallest to largest restores the sequence.
Related
- Insert an Empty Checkbox in Word: Easy Methods
- How to Insert Figures Into a Table of Contents in Word
- Insert an Editable Checkbox 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 Change the Outlook View to Show a Message PreviewTo show a message preview in Outlook, turn on the Reading Pane: in new Outlook for Windows, select…
- How to Make Two Numbered Columns in Microsoft WordTo make two numbered columns in Word, choose Layout > Columns > Two, then start or select one…
- Remove All Formatting in Word Without Losing TextTo remove formatting from a Word document, save a copy, press Ctrl+A on Windows (Command+A on Mac), then…
- How to Add Double Spacing in WordTo double-space text in Microsoft Word, select the text—or press Ctrl+A on Windows or Command+A on Mac to…
- Excel Cell Size: Adjust Row Height and Column WidthTo format cell size in Excel for Microsoft 365 on Windows, adjust the row height, the column width,…
- How to Create Multiple Address Labels in Microsoft WordTo create multiple address labels in Word, set up a recipient list, choose the label stock you have,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.