Excel sorted only amounts: rebuild the bank CSV rows

Updated · 2 min read

If only a bank CSV’s amount column was sorted in Excel, the total can still agree while individual transactions are wrong. Stop editing the damaged copy. Preserve it and rebuild from a retained source or trustworthy prior version rather than matching equal amounts by guesswork.

Official reference.

The desktop apps export date, description, and amount as CSV. Open CSV in Excel to save an XLSX workbook. Statement support varies: verify the result against your own PDF.

Establish whether the tuples changed

Keep each source transaction’s date, description, amount and source-row identity together. Compare complete tuples with the damaged workbook. A permutation of amounts leaves their sum unchanged, so a net-balance check cannot establish intact rows. Repeated amounts make reconstruction by amount especially ambiguous.

Microsoft warns against sorting a smaller range inside a larger related range. For a normal worksheet range, Expand the selection includes adjacent data; table behavior differs. When rebuilding, load the retained source into a separate working sheet and sort the full intended dataset. This prevents another partial-column sort but does not repair associations already lost.

Rebuild from evidence

These are the exercise’s invented source and damaged amounts; the event identities stay attached to the date and description:

EventRetained source identityRetained source amountDamaged copy amountResult
A2026-09-01 / alpha1020Wrong tuple
B2026-09-02 / beta20-5Wrong tuple
C2026-09-03 / gamma-510Wrong tuple
Net—2525Equal total conceals all three wrong associations

The synthetic sort-damage exercise starts with three event tuples and swaps their amount positions. Count and net sum remain identical, but the tuple multiset differs. Rebuilding from the retained keyed source restores the exact tuples. A separate control pair, X and Y, has two amounts of 25 with different descriptions; matching on amount cannot identify which description belongs to which event.

Compare the rebuilt file’s full event set and fields with its retained source before exporting. Keep any legitimate subsequent manual edits separately for reviewed reapplication; blindly replacing the workbook could lose them. Without an original or another reliable association record, mark uncertain rows unresolved instead of manufacturing a recovery.

This is a Python reference comparison of invented tuples, not an Excel recovery test. For duplicate source transactions rather than broken column associations, use the separate CSV deduplication guide. The corrective task here is restoring row relationships, not deleting similar payments.

Related task.

For a PDF-only bank source, download LocalExtract. It processes one PDF locally to date,description,amount CSV; it does not access platform accounts or synchronize accounting records.

Official sources and scope

Documentation checked October 16, 2026. Official reference 1 — excel-sort

LocalExtract Team

We build LocalExtract, a desktop bank statement converter. Questions or corrections? Contact · Editorial policy

Continue with a related guide