Excel Quick Tips: How to Flip Cells & Switch Rows or Columns

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.


Microsoft Excel is a powerful program that can help you analyze and visualize your data. For best results, your data needs to be in the proper format. If you need to flip the cells in a row or column, it can take a long time to do it manually—instead of re-entering all of your data, use these strategies to flip rows, turn columns into rows, and flip rows.

Unlock the FREE "Essential Excel Formulas" cheat sheet now!

This will sign you up to our newsletter

Enter your Email

Flipping Cells in Excel Columns

Reversing the order of cells in a Microsoft Excel column is quite easy, and can be done in just a few steps:

  1. Add a column next to the column you’d like to flip.
  2. Fill that column with numbers, starting with 1 and going up to the number of rows in the column you’d like to reverse.
  3. Select both columns and click Data > Sort. Select the column that you just added and filled with numbers. Select Largest to smallest, and click OK.


Once you’ve done this, the column you wanted flipped will be reversed, and you can delete the column you just created.

If you’re a user of Visual Basic (macros) with Excel Better Than Batch: A Windows Scripting Host Tutorial Better Than Batch: A Windows Scripting Host Tutorial Read More , you can use this code to accomplish the same thing. Just select the column you want to flip and run the following macro:

Sub FlipColumns()
 Dim vTop As Variant
 Dim vEnd As Variant
 Dim iStart As Integer
 Dim iEnd As Integer
 Application.ScreenUpdating = False
 iStart = 1
 iEnd = Selection.Columns.Count
 Do While iStart < iEnd
 vTop = Selection.Columns(iStart)
 vEnd = Selection.Columns(iEnd)
 Selection.Columns(iEnd) = vTop
 Selection.Columns(iStart) = vEnd
 iStart = iStart + 1
 iEnd = iEnd - 1
 Application.ScreenUpdating = True
End Sub

Transposing Columns Into Rows (and Vice Versa)

If you have a column of numbers that you want to turn into a row, Microsoft Excel has a very useful function to do just that for you with minimal effort.

  1. Select the columns you’d like to transpose and hit Ctrl+C or Edit > Copy.
  2. Click to an open cell and click Edit > Paste Special…
  3. Select Transpose and hit OK.


Your column has now been turned into a row, with the topmost value placed on the left of the row. To turn a row into a column, you follow the same procedure. You can even transpose a block of data, which will turn the entire selection by 90 degrees.

Flipping Cells in Excel Rows

To flip all of the cells in an Excel row, you need to combine the previous two steps. Because Microsoft Excel doesn’t support sorting rows, you’ll need to first turn the row into a column by using the instructions for transposing above. Once the row has been turned into a column, you can use the instructions for flipping the values in a column.

After you’ve reversed the column, copy and paste it using Paste Special… and Transpose. It’s a rather roundabout way to get it done, but it works!

To do this in a far simpler manner, you can use Visual Basic How You Can Make Your Own Simple App With VBA How You Can Make Your Own Simple App With VBA Want to know how to make your own VBA application to solve problems? Use these tips to build your own VBA software. Read More again. Just run the same macro as above, but replace all of the instances of the word “column” with the word “row.”

Sub FlipRows()
 Dim vTop As Variant
 Dim vEnd As Variant
 Dim iStart As Integer
 Dim iEnd As Integer
 Application.ScreenUpdating = False
 iStart = 1
 iEnd = Selection.Rows.Count
 Do While iStart < iEnd
 vTop = Selection.Rows(iStart)
 vEnd = Selection.Rows(iEnd)
 Selection.Rows(iEnd) = vTop
 Selection.Rows(iStart) = vEnd
 iStart = iStart + 1
 iEnd = iEnd - 1
 Application.ScreenUpdating = True
End Sub

Flipping Excel Cells Made Easy

If you need to flip the data in a Microsoft Excel column or row, using one of the strategies above can save you a whole lot of time. And if you need to do it on a regular basis, using the Visual Basic macros will save you even more time. Now get out there and flip some data!

Of course, there’s plenty more you can do with Excel. Check out these crazy Excel formulas that do amazing things or review our essential Excel formulas and functions cheat sheet The Essential Microsoft Excel Formulas and Functions Cheat Sheet The Essential Microsoft Excel Formulas and Functions Cheat Sheet Download this Excel formulas cheat sheet to take a shortcut through the world's favorite spreadsheet program. Read More .

Explore more about: Microsoft Excel, Microsoft Office 2013, Microsoft Office 365, Microsoft Office Online.

Whatsapp Pinterest

Enjoyed this article? Stay informed by joining our newsletter!

Enter your Email

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Seth
    January 29, 2018 at 4:55 pm

    Great tip for flipping a column!

  2. ronald moore
    November 3, 2017 at 9:27 pm

    You rock!

  3. Kevin
    February 17, 2016 at 7:54 pm

    The sorting works fine but I need an extra step... If you could advise.
    My project involves gathering random rows between 1 & 12. Then flipping them upside down. Then retrieving certain data from them. Simple lookups gather the info but, for example if I have 3 rows, (then flipped they become 12,11 and 10) but I would need row 10 to be at the top for the lookups to work. I've tried INDEX but to no avail :( any advice?

  4. jonathan
    January 13, 2016 at 6:35 pm

    If you have a lot of rows, start your new column with "1", then make the next value "=A1+1" (If A1 is where "1" is). Copy+Paste this formula down the entire column, then do your sort. No VBA required.

  5. Anonymous
    November 10, 2015 at 12:16 am

    This doesn't work for sorting random groups of numbers. Using your sort method would just sort both columns from greatest to lowest or whatever. Do you have any ideas for flipping columns of numbers?

    • Dann Albright
      November 10, 2015 at 4:29 am

      I'm pretty sure this does work for random numbers; the column that's being sorted is the one next to your column of numbers, not the random ones you've entered. Do you know what I mean? Or maybe I'm not understanding the problem you're having. Can you give me any more details?

      • HikingMike
        June 9, 2017 at 4:18 pm

        The problem is if there is no column of ordered numbers. He probably just wants to switch the order of the values, and there isn't any A-Z or whatever that sorting can go by. I suppose you could manually add a column of increasing numbers or a formula to number them like you said above. Some extra work required. I was able to do this. Though after swapping, the column with numbers derived from formula is broken.

        I am still curious if there is a way to reverse the order without any column that is in some kind of ascending/descending order already.

  6. Maria
    May 21, 2015 at 3:34 pm

    Impressive solution! So simple but I hadn't imagined it, thanks! !

    • Dann Albright
      May 23, 2015 at 8:49 am

      Glad you found it useful! It's saved me a lot of time.

  7. Bob
    March 3, 2015 at 3:19 pm

    Actually, you can sort Excel data in rows using the menu. When you click the "Sort" button and then select "Options...". Click the "Sort left to right" radio button.

    • Dann Albright
      March 4, 2015 at 8:54 am

      Right, but if you can do it the hard way, why would you choose to do it the easy way?

      Thanks for pointing that out. I was completely unaware of that option.