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](/google-sheets/preserve-header-row-position-during-sorting/header-row-shifted-after-sorting.png)
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](/google-sheets/preserve-header-row-position-during-sorting/frozen-header-row-in-place.png)
It is much faster than manually returning the header row or working around the issue by sorting everything but the header.