CSV sorting guide
How to sort a CSV by text or numeric columns
Sort by State ascending, Amount descending, or up to three prioritized keys. Rows equal on every selected key retain their original order.
Example: highest sales within each state
Sort State as ascending text and Amount USD as descending numbers, with blanks last.
- Key 1: State, text, ascending
- Key 2: Amount USD, number, descending
- Blank values: last
Unsorted sales
States and amounts are mixed in the input.
Invoice,State,Amount USD
V001,Texas,840.00
V002,California,1280.00
V003,Texas,2150.00
V004,California,990.00Sort by multiple columns
Choose Number for numeric fields so 100 sorts after 20.
- Open Sort rows and choose the CSV.
- Configure column, type, direction, and blank placement for key 1.
- Add and reorder up to two more keys when needed.
- Confirm case sensitivity and run the sort.
- Verify counts and check the first and last rows, then download.
State ascending, amount descending
California precedes Texas, and the larger amount comes first within each state.
Invoice,State,Amount USD
V002,California,1280.00
V004,California,990.00
V003,Texas,2150.00
V001,Texas,840.00Common sorting mistakes
Text and number modes produce intentionally different orderings.
- Sorting money as text
- Selecting Number for values with commas or currency signs
- Sorting mixed date formats as plain text
- Assuming ascending or descending decides blank placement
Where this sort fits
It is useful for presentation order and as a preparation step before deduplication.
- Good fit: up to three text or numeric keys
- Good fit: preserve the order of ties
- Date-aware sorting and language-specific alphabetical order are unsupported
- Use Group and summarize to create summaries