How to Preserve Header Row Position During Sorting in Google Sheets

In this post, we will look at a quick lifehack. If you sort data in Google Sheets via the Main Menu -> Data -> Sort ... as well as the context menu and the data has a header row, the former will be sorted along with the rest of the data:

The header row got sorted as well
The header row got sorted as well

There is an easy way to avoid it: freeze the header row, and it will stay in place after sorting:

The frozen header is not sorted
The frozen header row is not sorted

It is much faster than manually returning the header row or working around the issue by sorting everything but the header.