To flip a table upside down in Excel, reverse the order of its data rows while keeping each row’s values together: add a temporary sequence-number column, sort that column from largest to smallest, then remove the helper column. Keep the header row at the top. This guide is for Excel for Microsoft 365 on Windows; the same sorting and formula methods are available in current Excel for Mac and Excel for the web, though the ribbon layout can differ slightly.
What You’ll Need
- An Excel workbook containing a rectangular data range or an Excel table, ideally with one header row.
- A blank column for temporary sequence numbers if you use the reliable sorting method. Make sure it will not overwrite other data.
- Alternatively, Excel 2021 or Microsoft 365 if you want to use the dynamic-array formula method.
- A copy of the workbook or an extra copy of the data if the original order needs to be preserved exactly.
Step-by-Step
- Check what you want to reverse. In most cases, flipping a table upside down means reversing the order of its records: the bottom data row becomes the first data row, and the first data row becomes the last. The columns and the values within each record stay in their original positions. The header remains at the top; do not include it in the reversal. If you meant to switch rows and columns, that is a different operation called transposing.
- Make a safe working copy. If preserving the current order matters, duplicate the worksheet or copy the table to another location before changing it. Sorting changes the visible order of the records. You can usually undo a sort immediately with Ctrl+Z on Windows or Command+Z on Mac, but having a copy is safer, especially if you perform other edits afterward.
- Add a helper column beside the data. Insert or use a blank column next to the table and give it a clear header such as Original order. For a normal range, put the header in the same header row as the other column names. For an Excel table, add the new column directly beside the table so it becomes part of the table. Do not place the helper numbers in the middle of a record or in a column containing data you need.
- Number the data rows from top to bottom. Enter 1 beside the first data row, 2 beside the next, and continue until every record has a number. The number should identify the row’s current position, not a value such as a date or customer ID. To fill a simple sequence quickly, enter 1 and 2 in the first two data cells, select both, then drag the fill handle down. Check the last few entries to confirm the numbers increase by one and that no row has been skipped.
- Select and sort the entire table, not just the helper column. Click a cell in an Excel table, or select the complete rectangular range including all data columns and the helper column. On Windows, choose Data > Sort. In the Sort dialog, check that the correct range is shown and that My data has headers is selected if your first row contains column names. Under Column, choose Original order. Under Order, choose Largest to Smallest, then select OK. The row numbered highest now appears first, and the row numbered 1 appears last.
- Confirm that the records stayed intact. Compare a few distinctive values across columns before and after the sort. For example, confirm that each person’s name is still beside their own order number and date. If you sorted the whole range or table by the helper column, each record should have moved as one unit. If you accidentally sorted only the helper column, undo immediately and repeat the sort with the full range selected.
- Remove the helper column if you no longer need it. Once you have verified the reversed order, delete the temporary column. In an Excel table, right-click its header and choose Delete > Table Columns. For a normal range, select the helper column cells and use Home > Delete > Delete Sheet Columns only if the whole worksheet column is safe to remove; otherwise clear or delete just the helper cells. The reversed row order remains after the helper numbers are removed.
Formula alternative: If you have Excel 2021 or Microsoft 365, you can create a reversed copy without sorting the source. With data in A2:C5, no header included, and the goal of reversing those four rows, enter this formula in a blank area outside an Excel table:
=SORTBY(A2:C5,ROW(A2:A5),-1)
The formula returns the contents of row 5 first, then row 4, row 3, and row 2, preserving the values across each row. Put the column headers above the results separately if you want them displayed. The output spills into adjacent cells, so keep that space empty. This makes a reversed view rather than rearranging the source data; edits to the source are reflected in the result. The fixed ranges shown here do not automatically expand to include new rows, so update them when the source range grows. SORTBY is also available in current Excel for Mac and Excel for the web. If Excel shows a spill error, clear the cells in the formula’s output area.
Common Mistakes
- Sorting only one column: This can separate names, dates, amounts, or other fields that belong together. Select the complete data range or sort an Excel table by its helper column.
- Including the header in the sequence: The header is not a record. Keep it at the top and number only the data rows. If Excel treats a heading as a record, undo the sort and check the header setting in the Sort dialog.
- Sorting by the wrong field: Choosing a date, name, or ID column may reorder the data by that value rather than reverse its original order. Choose the temporary Original order column and set it to Largest to Smallest.
- Using duplicate or incomplete sequence numbers: Tied numbers do not specify a unique original order, and missing numbers can make the result confusing. Use a consecutive number for every data row and check the sequence before sorting.
- Expecting Excel to rotate cells or text: Sorting reverses the order of records; it does not turn the worksheet grid upside down, rotate text, or mirror the table. Transpose is for swapping rows and columns, not for reversing their order.
- Deleting the wrong column: Removing a worksheet column can also delete unrelated data below or beside the table. If the helper column is not safe to remove as a whole sheet column, clear only the helper cells or use the table-column delete command.
Tips
- Use an Excel table for regularly updated data. Select the range and choose Home > Format as Table, then confirm whether the range has headers. A table helps keep new records and their fields together when sorting. Add the helper column as a table column before numbering.
- Keep the source and reversed view separate when possible. The formula approach lets you display records in reverse order without changing the original. This is useful for reports where the source must remain chronological or in its original import order.
- Label the result clearly. If the reversed copy is for someone else, add a note such as Reversed view and retain the column headings. That makes it less likely readers will mistake the result for the untouched source.
- Check filters and hidden rows. A filter may mean only visible records are being considered, and manually hidden rows can make the displayed result look incomplete. Clear filters or review the full range before deciding the reversal is finished. If you need to preserve a filtered subset, work on a copy and verify exactly which records are included.
- Choose the method that matches the goal. Use the helper-column sort when you need to change the actual row order. Use SORTBY when you need a live, separately displayed reverse-order copy. Neither method transposes the table or changes the left-to-right order of its columns.
Troubleshooting
The header moved into the data. Undo with Ctrl+Z on Windows or Command+Z on Mac. Open Data > Sort, select My data has headers, and confirm that the selected range starts with the header row. Then sort by the helper column again.
Values no longer match their rows. Undo the sort right away. Select the whole table or complete data range, including every field and the helper column, then sort again. If the wrong cells were moved and the workbook has since been edited, restore a saved copy or use version history rather than trying to pair records by guesswork.
The sort order looks unchanged or unexpected. Check that the helper numbers increase from top to bottom and that you selected Largest to Smallest, not Smallest to Largest. Also check that the sort dialog is using Original order, not another column. Text-formatted numbers or duplicate entries may affect sorting; replace them with a clean, consecutive numeric sequence if needed.
The formula returns an error or will not spill. Confirm that the formula is entered in a blank area with enough empty cells to the right and below for the complete result. Remove any content, merged cells, or other obstruction from the spill area. Check that the source ranges have matching row counts: the range to return and the ROW range must cover the same number of rows. If your Excel version does not recognize SORTBY, use the helper-column sorting method instead.
New rows are missing from the reversed formula result. The example formula uses fixed cell references. Extend both source ranges to include the new records, or use a table-based setup and adjust the formula to cover the intended table rows. Do not include the header in the data range unless you deliberately want it included in the returned array.
Frequently Asked Questions
Does flipping a table upside down also reverse its columns?
No. Reversing the rows changes the top-to-bottom record order only. The left-to-right order of fields remains the same. To swap rows and columns, copy the range and use Home > Paste > Transpose from the Paste options, or use Paste Special and select Transpose.
Can I reverse the order without adding a helper column?
Yes, with Excel 2021 or Microsoft 365, use SORTBY in a blank area to display a reversed copy. The formula method does not rearrange the original cells. If you need to change the source table itself, a temporary helper column is the clearest way to tell Excel the original order.
Will sorting break formulas or formatting?
Sorting a complete Excel table or range normally moves each row’s values and formatting together. Formulas in the records generally adjust with their rows, but formulas that refer to positions elsewhere in the sheet may produce different results after sorting. Review important formulas and totals afterward, and avoid sorting only part of a range.
Can I reverse a table that has filters?
Yes, but check whether you want to reverse every record or only the filtered records you can see. Sorting a table with a filter may apply to the table while keeping filtered-out records hidden. Clear the filter first if the goal is to inspect the entire reversed table, or make a copy and verify the filtered result if only a subset is needed.
How do I flip the table back to its original order?
If you have not made other changes since sorting, use Ctrl+Z on Windows or Command+Z on Mac. If the helper column is still present, sort it by Original order from smallest to largest. If you removed it, you will need another saved copy or a new sequence column based on the current order; the removed original sequence cannot be reconstructed automatically.
Can I do this in Excel for Mac or Excel for the web?
Yes. The helper-column method works in current Excel for Mac and Excel for the web, although controls may be positioned differently. Use the Data tab’s sort controls to sort the helper column descending. SORTBY works in current Microsoft 365 versions on those platforms as well; if the function or sort option is unavailable in your version, use the other method or update Excel.
Related
- IF Rules in Google Sheets: How Formulas and Rules Work
- Inventory Spreadsheet in Google Sheets or Google Docs?
- Google Sheets Inventory Spreadsheet: Setup and Tips
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 a Shared Mailbox to Outlook on Any DeviceTo add a shared mailbox to Outlook, first ask your Microsoft 365 or Exchange administrator to grant your…
- How to Share Excel Files in Google Sheets With OthersTo share an Excel workbook in Google Sheets, upload the .xlsx file to Google Drive, open it in…
- How to Freeze Panes in Excel: Keep Rows and Columns VisibleTo keep headings or identifying columns visible while you scroll in Excel for Microsoft 365 on Windows, select…
- Multiple SUMIFS in Google Sheets: Criteria and ExamplesYes. In Google Sheets, use one SUMIFS for conditions that must all be true, and add separate SUMIFS…
- How to Delete Track Changes in Word and Accept EditsTo remove tracked edits in Microsoft Word, save a copy of the document, then go to Review >…
- Google Sheets Formula to Count Cells With Text ValuesTo count cells containing text in Google Sheets, use =COUNTIF(A2:A100,"*"), replacing A2:A100 with your range. It counts text…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.