To flip the order of rows in Excel, add a helper column numbered from top to bottom, then sort that column from largest to smallest. This reverses the existing sequence while keeping each row’s information together. For a formula-based result in Microsoft 365, use SORTBY and SEQUENCE; to reverse columns instead, sort left to right or use a horizontal SORTBY formula.
“Flip order” usually means reverse the current sequence, not sort names or dates alphabetically. The instructions below are for Excel for Microsoft 365 on Windows. Make a copy of important data before sorting, and decide whether you want to change the original range or create a separate reversed copy.
What You’ll Need
- An Excel workbook with the rows or columns you want to reverse.
- A clear idea of whether headings should stay in place and whether other columns must move with the records.
- For the formula option, Microsoft 365 or Excel 2021 or later, where SORTBY and SEQUENCE are available.
- A spare column or row if you plan to use the helper-number method.
Step-by-Step
- Choose what you mean by flip. To reverse a vertical list, change the top-to-bottom order. To reverse a table, move each complete record as a unit so names, dates, and values remain associated. To reverse columns, change the left-to-right order. The helper-column method is the most dependable choice for rearranging the original rows; a formula is useful when you want a separate live result.
- Check the range before changing it. Identify the first and last data rows, and note whether the first row contains headings. Check for nearby data that should not be included in the sort. If your records occupy A1:C5, for example, row 1 might contain headings and rows 2 through 5 the records. Do not include the heading row in a formula intended to reverse only the records.
- Add a helper column for a permanent row reversal. Insert an empty column beside the records, or use an already empty one. Give it a clear heading such as Order. In the first data row, enter 1; in the next, enter 2. Select both numbers and drag the small fill handle down to the last record. Confirm that the numbers increase by one and each record has exactly one number. Because every number is unique, this method reverses records even when names, dates, or other fields contain duplicates.
- Sort the complete range by the helper values. Click a cell in the data and choose Data > Sort. In the Sort dialog, select the helper column in the Sort by field, leave Sort On set to Cell Values, and choose Largest to Smallest for Order. If Excel asks whether to expand the selection, choose Expand the selection so every field in a record moves together. Check that the dialog recognizes your headings; if it does not, correct the header setting before sorting. Select OK.
- Check the result and remove the helper if appropriate. The record that was last should now be first, and the original first record should be last. Verify at least two fields in several rows to make sure the records stayed intact. If the order is correct, you can delete the helper column. Deleting it does not undo the sort; it only removes the temporary numbers. Save the workbook when you are satisfied.
- Use a formula when you want a separate reversed copy. Suppose the headings are in A1:C1 and the records are in A2:C5. Enter the following in an empty cell with enough blank space to the right and below. It returns all four records in reverse row order, while the source data remains unchanged:
=SORTBY(A2:C5,SEQUENCE(ROWS(A2:A5)),-1). With four records, SEQUENCE creates 1, 2, 3, 4, and SORTBY orders the rows by those values descending, so row 5 appears first and row 2 last. Include all columns that belong together in the first range. - Reverse a single list with the same formula pattern. If the list is in A2:A6, put the formula in a different empty cell:
=SORTBY(A2:A6,SEQUENCE(ROWS(A2:A6)),-1). The result lists A6, A5, A4, A3, and A2 in that order. The formula result updates if a value in the source range changes, but it does not automatically include new records added outside the specified range. Extend the range when your list grows. - Reverse columns with a horizontal formula or the Sort dialog. If the block is A1:E3 and you want its columns returned in reverse order, enter this formula in an empty area:
=SORTBY(A1:E3,SEQUENCE(1,COLUMNS(A1:E1)),-1). It sorts the five columns by the generated sequence 1 through 5 in descending order, so column E appears first and column A last. If you prefer to rearrange the original columns, add a helper row of increasing numbers, select the whole block and helper row, then open Data > Sort > Options, choose Sort left to right, and sort by the helper row from largest to smallest. Confirm the selected range and headings in the dialog before accepting.
In Excel for the web, the helper-column approach is a practical option, and current Microsoft 365 builds support the dynamic-array formulas above. The desktop Sort dialog offers more control for left-to-right sorting. Excel for Mac has comparable sort and formula features, though dialog placement can differ. For Undo, use Ctrl+Z on Windows or Command+Z on Mac.
Common Mistakes
Sorting just one column. If you select only the helper numbers or one field and sort it, the values can become detached from the rest of their records. Sort the complete data range. If Excel prompts you, choose Expand the selection rather than continuing with the current selection.
Including headings in the reversal. A heading is a label, not a record. If it is sorted with the data, it can end up at the bottom or be treated as a value. Keep headings outside the formula range, or tell the Sort dialog that the range has headers. For horizontal sorting, carefully check which rows should move and which labels should remain fixed.
Sorting by the wrong field. Sorting by a date or name changes the data into date or alphabetical order; it does not necessarily reverse its original sequence. Use a unique helper sequence and sort it descending when the goal is to flip the existing order.
Typing over a formula result. SORTBY returns a spilled array that occupies neighboring cells. If those cells contain anything, Excel may show a #SPILL! error. Put the formula in a clear area and leave enough room for the full result.
Expecting a reversal to stay linked to the original positions. A helper-column sort changes the current row order. The helper values remain attached to the records until removed, but deleting the helper means you cannot use it to restore the prior sequence later. Keep a copy or retain a separate original-order number if you may need to restore it.
Tips
For a one-time change to a dataset, use the helper column. It works with older Excel versions and is easy to inspect. For a view that should update when source values change, use a formula in a separate area. A formula does not rearrange the original records, which can be an advantage when you need to compare both orders.
Turn a regular data range into an Excel table with Insert > Table if you frequently add records. Tables make headings and fields easier to identify, and new rows can be included more naturally in table operations. You can still create a helper field in the table and sort by it. Check the sort result after adding or removing records, because the helper sequence may need to be filled for every row.
Before a permanent sort, consider adding an original-position field with numbers such as 1, 2, 3, and so on. It gives you a way to restore the initial order later: sort that field from smallest to largest. This is especially useful when the workbook is shared or the sequence carries meaning that is not obvious from the data.
For formulas, keep the source and output ranges separate, and avoid placing the result inside an Excel table if the formula needs to spill into adjacent cells. If your source is a table, you can still reference its data, but test the formula in a blank area and confirm the output size. Save a copy before making a large structural change.
Troubleshooting
The rows did not reverse. Check that the helper values run upward from the first record to the last, and that the sort order is Largest to Smallest. If they run downward already, sorting descending will restore the original order instead. Also make sure the Sort by field is the helper column, not a date, name, or heading.
Fields no longer match their records. Undo immediately with Ctrl+Z on Windows or Command+Z on Mac, then repeat the sort using the entire range. If Undo is no longer available, restore a saved copy or use an original-position field to reassemble the order. Do not try to repair mismatched fields by sorting each column independently.
The formula shows #SPILL!. Clear cells where the result needs to appear, including cells that look blank but contain spaces or formulas. Make sure the output does not overlap the source range or a merged cell. Click the error indicator for Excel’s explanation of what is blocking the spill.
The formula returns an unexpected order or an error. Confirm that the formula range includes only the records to reverse and that the sequence range has the same number of rows or columns. Check for a mistyped range or missing parenthesis. SORTBY and SEQUENCE require Microsoft 365 or Excel 2021 or later; in an older version, use the helper method.
Left-to-right sorting is unavailable or confusing. Use Excel desktop and open the Sort dialog’s Options to choose Sort left to right. Select the range carefully, including the helper row and the columns to rearrange. If you only need a reversed view, try the horizontal formula in a blank area instead of changing the source block.
Frequently Asked Questions
Can I reverse rows without changing the original data?
Yes. Put a SORTBY formula in an empty area, using the original range as its first argument and a generated sequence as the sort key. The formula displays a reversed copy and leaves the source range in place.
Does sorting Largest to Smallest reverse any list?
It reverses the sequence only when you sort by a unique helper number that increases in the current row order. Sorting a text or date field instead arranges values by that field’s sort rules.
Can I flip only one column in a table?
Usually, you should not sort one table column by itself because that can separate its values from the related records. If you truly intend to reverse that one list independently, copy it to a separate range and reverse the copy there.
Can I reverse the order of columns as well as rows?
Yes. Use a horizontal helper row and the Sort dialog’s Sort left to right option, or use the horizontal SORTBY formula shown above. Check whether headings should move with the columns before applying either method.
Will a formula include new rows automatically?
Not if the formula refers to a fixed range such as A2:A6. Update the reference when you add records, or use a table-based range and verify the formula includes the table’s full data. A helper-column sort also requires the new row to receive a helper value.
Can I undo a sort?
Use Ctrl+Z on Windows or Command+Z on Mac soon after sorting. Once you have made further changes or closed the workbook, Undo may not restore the previous order. An original-position helper or a saved copy provides a more reliable recovery option.
Related
- Insert a Circle Checkbox in Word: Symbols and Options
- Insert a Checkbox in Excel or Word
- Insert a Checkbox in Word Without the Developer Tab
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Outlook: How to Export Contacts to a CSV FileTo export Outlook contacts, open People and choose Manage contacts > Export contacts in new Outlook or Outlook…
- Blank Label Template in Word: Create and Save Your LayoutTo create a blank label template in Word, open Mailings > Labels, choose the label brand and product…
- PowerPoint Master Slide: How to Create and Edit ThemesTo make a PowerPoint presentation consistent, open View > Slide Master, edit the top-level master or a specific…
- How to Double Space in Word Without the Design TabTo double-space text in Microsoft Word, select the text, open Home > Line and Paragraph Spacing, and choose…
- How to Insert a Blank Line in Word: Keyboard and Layout TipsTo insert a blank line in Microsoft Word, place the cursor where the gap should go and press…
- How to Share a Team Calendar in Outlook with PermissionsTo share a team calendar in Outlook, open Calendar, select the calendar you want coworkers to use, and…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.