Excel question, using the sort option

Can’t find any definitive answer for this. In Excel, I have a list of things in column 1 and a numeric value for these things in column 2. I select everything in both columns starting with cell A2. I select the sort function and want highest to lowest. Everything sorts except the item and number in row 1, it remains my original entry. If I swap the items and numbers between columns A and B then sort, the same things happen.

The only thing I found was something about a title in row 1 and this will not sort. I have not selected anything to make row 1 a title. I then tried moving all the info down 5 rows with my info starting in A6 and the number values in B6. Same thing happens, the first row of information does not sort. Swap the info and number columns, same thing happens. Is there a way to stop this? I also found this happens if I sort alphabetically too.

There might be a checkbox that says “data has headers” inside the Sort window, when you specify the type of sorting you want

The alternative is to just type in header names in the first row, select them with the data and let them stay unsorted the way excel is trying to do it.

I think that’s really it. I’m pretty sure Excel assumes you have headers in your first row, and excludes that from being sorted.

Which makes sense; if you have a big data set, and accidentally sort your headers into it, that can take a while to remedy, versus just going and un-checking a box.

The best way to sort in Excel is to highlight your data, right-click and choose “Custom Sort”- that actually gives you control over what gets sorted for each column and in what order, etc… as well as headers and other stuff.

Wait a minute: it sounds like you’re not selecting row 1, so why would you expect it to be among the rows that get sorted?

Just click anywhere in your data.

Select Data>Sort.

It will highlight all the data and the sort box will pop up. It has a tickbox on the top right for my data has headers.

If it doesn’t and it is ticked, untick it and choose the column that you want to sort by.

If I may ask a related question…

Whenever I sort in Excel, a part of me quakes at the thought that there is a possibility of my data becoming scrambled (that is, the rows do not stay properly arranged post-sort).

Is this even something to worry about? Is there even an option that would ask Excel to sort just one column, thereby detaching it from the other columns and leaving a holy mess?

I know that if it does happen, I can UNDO it, but I am a little concerned that it could happen without me noticing it quickly enough (some of my databases are very large with multiple columns, it would be a nightmare if it got mixed up).

Thanks,

mmm

If your data is that structured that you refer to it as a ‘database’ then convert it to a ‘Table’ (Insert tab/Table)

Sorting a table will always select the full table by default. There are other advantages like, when entering data, if you tab right off the last column Excel will add a new row to the table, move the cursor to the first column and automatically insert any cell formulas in the new row.

I’ve done this by accidentally selecting only a single column of data rather than the multiple columns I wanted to include. That is, only the selected column sorts and the rest of the data doesn’t, and yes, it’s a mess. Always check what is being selected to ensure it includes everything. IIRC, automatic selection stops when it encounters a blank row or column so be certain your data doesn’t include either, or select the sort area manually.