Multiple keyword sorting
🔀 Sort settings
💡 Instructions for use
- Column numbers are counted from left to right in the data, and the first column is one, which is consistent with the column order in the spreadsheet software.
- Text comparison is arranged in character order, and Chinese is in encoding order, so it is more suitable for names and numbers; numerical comparison will be parsed into numbers first and then compared.
- After setting the second sort key, rows with the same value in the first column will be sorted according to the rules of the second column, and the result will be more in line with daily habits.
- When the header is fixed, the first row does not participate in sorting and the position remains unchanged; if the first row is data, please switch this option to Unfixed.
- The sorting is a stable sorting, and rows with identical values maintain their original order without disturbing their relative positions.
- The data is only processed in the browser and is not uploaded or saved; if you need to keep the file, please copy or download the results.
The rankings that are inseparable from the first column are given to the second column and continued.
what problem to solve
When sorting by only one column, the order of rows with the same value in that column is undefined.
After adding the second column, there are clear rules for the order of these rows.
Priority order
The first column takes precedence, and only the second column is looked at if the first column has the same value.
The order of the two levels cannot be reversed, otherwise the results will be completely different.
Typical usage
Sort by group first, then by score in descending order, and you can see the list at a glance.
Sort by department first, then by joining date to facilitate filing and checking.
comparison method
Two columns can each use their own comparison methods, one column of values and one column of text.
The directions can also be set separately without affecting each other.
Result check
First confirm whether the first column is in order, and then look at the order of the second column of rows with the same value.
Randomly check two sets of data with the same value to verify whether the priority is effective.
The first column takes priority and the second column takes precedence; the comparison method and direction of the two columns can be set separately.
📖 Glossary
- sort key
- The column according to which the sorting is based can be a single column or a combination of multiple columns arranged according to priority.
- Ascending and descending order
- Ascending order is from small to large or forward in character order, while descending order is the opposite. The results of the two directions for the same set of data are completely reversed.
- stable sorting
- Rows with the same sort key value maintain their original order and will not be swapped due to sorting.
- numerical comparison
- First parse the cell content into numbers and then compare the sizes to avoid misordering when comparing by characters.
- text comparison
- Compare one by one in character encoding order. Chinese characters are usually arranged in encoding order, which is suitable for names and numbers.
- multi-level sorting
- Sort by the first column first, then sort by the second column if the values are the same, and so on to form a hierarchical order.
- Header
- The field names in the first row of the table should be fixed in the first row when sorting to avoid being treated as data for comparison.
- Group sorting
- First sort by a certain column within the group, and then decide the order of the groups. It is often used to organize lists by department or region.
- Null value handling
- The arrangement position of the cell when it is empty. When comparing numerical values, space-time values are usually sorted at the end, making it easier to see valuable data first.
- delimiter
- Characters used to separate columns, tabs used for content copied by spreadsheet software, and commas used for comma-delimited files.
🔗 All keywords and tutorials
❓ FAQ
- When does the second column come into play?
- Only the first column is compared if the values are the same.
- Can the directions of the two columns be different?
- Yes, the direction and comparison method of each column can be set independently.