How to flip / reverse a column of data order vertically in Excel?

Sometimes, you may want to flip a column of data order in Excel. It seems quite hard to reverse the data order manually, especially for a lot of data in the column. This article will guide you to flip or reverse a column data order vertically quickly.

Flip a column of data order in Excel with Sort command

Flip a column of data order in Excel with VBA

Flip a column of data order in Excel with Kutools for Excel

Supposing you need to flip the column of data in Microsoft Excel as shown in the following screenshot:


arrow blue right bubble Flip a column of data order in Excel with Sort command


Using Sort command can help you flip a column of data in Excel with following steps:

Step 1: Insert a series of sequence numbers besides the column. In this case, in insert 1, 2, 3…, 7 in Column B, then select B1:B7, see screenshot:

Step 2: Click the Data > Sort Z to A, see screenshot:

Step 3: In the Sort Warning dialog box, check the Expand the selection option, and click the Sort button.

You will see the number order of Column A is flipped. And then you can delete or hide the Column B according to your needs. See the following screenshot:

This method is also applied to reversing multiple columns of data order.


arrow blue right bubble Flip a column of data order in Excel with VBA

If you know how to use a VBA code in Excel, you may flip / reverse data order vertically as follows:

Step 1: Hold down the Alt + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.

Step 2: Click Insert > Module, and paste the following macro in the Module Window.

VBA: Flip / reverse a range data order vertically in Excel.

Sub FlipColumns()
'Updateby20131126
Dim Rng As Range
Dim WorkRng As Range
Dim Arr As Variant
Dim i As Integer, j As Integer, k As Integer
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Arr = WorkRng.Formula
For j = 1 To UBound(Arr, 2)
    k = UBound(Arr, 1)
    For i = 1 To UBound(Arr, 1) / 2
        xTemp = Arr(i, j)
        Arr(i, j) = Arr(k, j)
        Arr(k, j) = xTemp
        k = k - 1
    Next
Next
WorkRng.Formula = Arr
End Sub

Step 3: Press the F5 key to run this macro, a dialog is popped up for you to select a range to flip vertically, see screenshot:

Step 4: Click OK in the dialog, the range is flipped vertically, see screenshot:


arrow blue right bubble Flip a column of data order in Excel with Kutools for Excel

If you have Kutools for Excel installed, you can reverse the numbers order of columns with Flip Vertical Range tool quickly.

Kutools for Excel includes more than 120 handy Excel tools. Free to try with no limitation in 30 days. Get it Now.

Step 1: Select the column of data that you want to flip.

Step 2: Click Kutools > Range > Flip Vertical Range, then select the option you need. See screenshot:

doc flip column 01

Then the data in the column has been flipped vertically.

Tip:
If you select All that means flip the values with the cell format, and if you select Only flip values that means just flip cell values without cell format.

Click Flip Vertical Range to know more about this feature.


Related article:

How to flip / reverse a row of data order in Excel quickly?

 

Recommended Productivity Tools

Office Tab

gold star1 Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.

Kutools for Excel

gold star1Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!

gold star1200 New Features for Excel, Make Excel Much Easy and Powerful:

  • Merge Cell/Rows/Columns without Losing Data.
  • Combine and Consolidate Multiple Sheets and Workbooks.
  • Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
  • Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,
  • More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...

Screen shot of Kutools for Excel

btn read more btn download btn purchase

Comments  

Permalink +4 venkatesh
Hi, Its a simple and nice solution thanks a lot.
2013-11-25 10:25 Reply Reply with quote Quote
Permalink +1 sanket bagadia
great save time.......very good
2013-12-10 10:36 Reply Reply with quote Quote
Permalink 0 Keno
The macro for reversing the cell order did not work for me with my copy of Excel for Mac 2010 14.3.9. Instead, all cells to which the macro was applied were filled with this: "####".
2014-01-30 22:14 Reply Reply with quote Quote
Permalink +3 LisaR9
Just widen the columns and see if that helps
2014-09-17 17:28 Reply Reply with quote Quote
Permalink +2 EV
Very simple solution! I was complicated my life when the solution was right in front of me!!

Thank you! :D
2014-02-09 14:05 Reply Reply with quote Quote
Permalink 0 Marc
So much help thank you I was not willing to copy paste stuff just for the sake of my teachers formatting requirements.
2014-02-24 02:35 Reply Reply with quote Quote
Permalink +2 Sahil
In the next column enter numbers 1 thru 7 (one per row), select both columns and sort descending by the second column
2014-06-25 06:15 Reply Reply with quote Quote
Permalink 0 SA10
Thanks that did it but I lost my conditional formatting. Is that normal?
2014-08-01 19:51 Reply Reply with quote Quote
Permalink -1 Carissa
Awesome, thanks! Easy.
2014-10-20 03:09 Reply Reply with quote Quote
Permalink 0 vikas kumar dixit
Just simply i m try to flip my data how m doing????

Ex. i m try to vikas dixit to dixit vikas it's possible or not.????

please reply
2014-12-02 05:59 Reply Reply with quote Quote
Permalink 0 morso
hi thank u ,it was very useful
2015-05-07 07:12 Reply Reply with quote Quote
Permalink -1 Saikumar
Hi, Thanks a lot, it is really so simple using using Data - Sort
2015-08-07 07:12 Reply Reply with quote Quote
Permalink -6 Duncan Adams
Why .. why in the hell do people and not just you ... have to prove how to reinvent the wheel and show how to do things that don't need to be done .
How to flip / reverse a column of data order vertically in Excel? All you have to do is tell people to hi - light the data and go push the a/z button and it's done . Yeah I don't know what I am doing .. excel is [censored] because it's hard to use ... but this was so easy and you make so hard . You're not and educator . Duncan Adams
2015-11-08 14:02 Reply Reply with quote Quote
Permalink +4 Wormeh
That's actually not true. The A/Z button SORTS it (usually from low to high or form a to z), but it doesnt FLIP it. Yes, it does flip when it's ordered from a to z or from low to high, but what if it's not? So yes, this is useful. Please think before you speak Duncan.
2015-12-21 13:52 Reply Reply with quote Quote
Permalink 0 Kevinbd83
Basically I need the same as above but the amount of fields vertically can change from 1 to 12. Then, for example 3 fields, I would need number 3 to be at the top... If 11 then 11 at the top. It's random everytime between 1&12 though. Any ideas? As trying INDEX but to no avail :(
2016-02-17 19:35 Reply Reply with quote Quote
Permalink 0 MIHA
how i can change macro to flip horisontally?
2016-11-27 12:36 Reply Reply with quote Quote

Add comment


Security code
Refresh