If you're experiencing odd sorting behavior in Excel, there are a few things you can do to try and fix the issue.
First, check to see if the data you're trying to sort is formatted correctly. If it's not, that could be causing the issue. Make sure all of the data is in the same format (e.g. all dates should be in the same format, all numbers should be in the same format, etc.)
Next, check to see if there are any blank cells in the data you're trying to sort. Blank cells can cause issues with sorting, so if there are any blank cells, delete them or fill them in with a value.
If those two things don't fix the issue, it's possible that there are duplicate values in the data you're trying to sort. Duplicate values can cause issues with sorting, so if there are any duplicate values, delete them or change them so they're unique.
Finally, if none of those things work, it's possible that there's something wrong with Excel itself. Try restarting Excel and see if that fixes the issue. If not, you may need to reinstall Excel.