Sort by row (i.e. from left to right)

Sorting is easy, when the orientation of data is vertical.Excel Tip - Sort by row.gif

Although we are expecting data in a vertical layout, it is not uncommon that we still encounter data in a horizontal layout in real world.  Don’t you?

With data in a row, such simple task as sorting could become a headache to many people as sorting seems not working properly…Excel Tip - Sort by row 1.gif

Are you one of them?  Don’t worry.  It is totally doable.  What we need are just a few more clicks.

Go to Data –> Sort (not the sort ascending or descending icon) –> Options…

Select “Sort left to right” under Orientation –> OK

As simple as that, we can now sort by row instead of column.Excel Tip - Sort by row 2.gif

Just like sorting by column, we could add more than one level of sorting.

Nevertheless, the checkbox “My data has headers” turns grey once “Sort left to right” is select.Excel Tip - Sort by row 3

If you include your “header” for sorting, you may get unexpected result as shown below:Excel Tip - Sort by row 4

To make the sorting right, DO NOT include the labels on the first column.Excel Tip - Sort by row 5

A more practical application is to sort a table by header. Watch this:

Advertisement

About MF

An Excel nerd who just transition into a role related to data analytics at current company......😊 Recently in love with Power Query and Power BI.😍 Keep learning new Excel and Power BI stuffs and be amazed by all the new discoveries.
This entry was posted in Excel Basic, Excel Tips and tagged . Bookmark the permalink.

2 Responses to Sort by row (i.e. from left to right)

  1. Ashish Gupta says:

    Like this site

    Like

Comments, suggestions, corrections are welcome.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.