Invoice and Check Number Gap Finder
Operator: Abdulla Al Fahad. How tools are built and checked
Invoices, credit notes, cheques and receipts are numbered so that a missing one stands out. In practice nobody spots it by reading a register of four thousand rows. A voided invoice that was deleted instead of cancelled, a cheque torn out of the book and never recorded, two staff members issuing the same number from different templates: each leaves a hole or a repeat that an auditor, a tax inspector or a bank reconciliation will eventually ask about.
This tool reads one column of such numbers from a CSV or Excel register and lists what is wrong with the sequence: the numbers that never appear, written as ranges with a count, the numbers that appear on more than one row, the values it could not read as a number at all, and the entries that step backwards in the order the file lists them. Add a date column and it also flags numbers that go up while the date goes back. The findings can be downloaded as a CSV report.
Key features
- Missing numbers as ranges, with the count and the two existing numbers either side
- Every missing number listed one per line, up to 10,000, with the total beyond that
- Numbers used more than once, with every row they appear on
- Values that could not be read as a number, with the reason
- Entries out of order in file order, with files listed newest first recognised
- Optional date column: flags numbers that go up while the date goes back
- Separate series per prefix, ignoring case and spaces, or one series for all values
- CSV or .xlsx input with sheet choice, and the whole report as one CSV
How prefixes, numbers and dates are read
Each value is split into a prefix and the run of digits at its end. INV-0042 has the prefix INV- and the number 42; CHK 2045 has the prefix CHK and a space; 1001 has no prefix. A value with text after its digits, such as INV-1001A or 1001 (void), is reported as not read, so it shows up for a human to look at instead of being guessed.
Spreadsheet formatting is undone where it is unambiguous. 1,001, 1001.00 and 1,001.00 are all read as 1001, because those come from number formats rather than from the numbering scheme. A decimal such as 12.5 or 1,001.50 is not a document number and is reported. A dotted scheme such as 2026.0042 keeps 2026. as its prefix, since a fraction of three or more digits is a sequence rather than cents. Numbers longer than 15 digits are reported, because they are reference codes rather than sequences.
In an .xlsx file, a whole number whose format pads it with zeros, such as 0042 shown from the value 42, keeps its padding. Date cells are read as calendar dates whatever their display format. In a CSV, dates are read as ISO dates (2026-03-05), as numbers with a four-digit year in the order you confirm (05/03/2026), or with month names (5 Mar 2026). Two-digit years are not guessed.
How it works
A CSV is checked for binary content in its first 8 KB and decoded as UTF-8, or as UTF-16 when it starts with that byte-order mark, then split into rows by the same parser the site's CSV converters use. A workbook is recognised by its ZIP signature and opened with SheetJS; the reader goes through the cells the workbook actually stores rather than every address inside the sheet's declared range, so a column formatted down to the last row of the sheet adds no empty rows to the check. In both cases the first row with any content is the header.
For the column you pick, every value is split into prefix and digits, and grouped into series by prefix. Within each series the numbers are sorted; neighbouring numbers more than one apart produce a missing range, written with the lower neighbour's prefix and zero padding, so the gap after INV-0999 starts at INV-1000. Numbers that occur more than once are listed with all their rows.
For the order check, each series is read in file order and the steps up and down are counted. If most steps go down, the file is taken to run newest first, and steps up are flagged instead. For the date check, the series is walked in number order and each number's date is compared with the date of the nearest lower number that has one.
Common use cases
- Checking a year of sales invoices for gaps before the accounts go to an auditor or an accountant
- Finding cheque numbers that were written but never entered in the cash book, ahead of a bank reconciliation
- Spotting duplicate invoice numbers after two people issued invoices from separate copies of a template
- Confirming that a receipt book's numbers run without a break, with credit notes kept as their own series
- Flagging invoices that were dated earlier than the invoice before them, which can mean a backdated document
How to use this tool
- Choose the CSV or .xlsx register, or press Use sample data to load ten invoices with known problems.
- For a workbook with several sheets, pick the sheet that holds the numbers.
- Check the number column the page picked, and pick a date column if you want the date check.
- If the dates are written like 03/04/2026, confirm whether the day or the month comes first.
- Read the report under the options, then press Download report (CSV) to keep a copy.
Example
The sample data: invoice_no and issue_date columns, 10 data rows
row 1 INV-0998 2026-03-02
row 2 INV-0999 2026-03-02
row 3 INV-1001 2026-03-03
row 4 INV-1002 2026-03-04
row 5 INV-1002 2026-03-04
row 6 INV-1005 2026-03-05
row 7 INV-1004 2026-03-05
row 8 INV-1006 2026-02-27
row 9 VOID 2026-03-06
row 10 INV-1007 2026-03-07Report (one series, INV-: 9 entries, lowest INV-0998, highest INV-1007)
Missing: INV-1000 (1), between INV-0999 (row 2) and INV-1001 (row 3)
Missing: INV-1003 (1), between INV-1002 (row 4) and INV-1004 (row 7)
Used more than once: INV-1002 on rows 4 and 5
Not read: VOID on row 9 (no number in the value)
Out of order: INV-1004 on row 7 comes after INV-1005 on row 6
Date goes back: INV-1006 on row 8 is dated 2026-02-27, earlier than INV-1005 dated 2026-03-05 on row 6Tips for best results
- Leave Treat each prefix as its own series on when one register mixes invoices (INV-) and credit notes (CN-); each gets its own gap list and its own lowest and highest number.
- Turn the series option off when the same numbers were written with and without a prefix, such as 1001 in one month and INV-1002 the next, so they are checked as one run.
- Pick the issue date column when there is one. The date check is the quickest way to find a number reused months later or an invoice backdated into a closed period.
- Open the Every missing number list when you need to paste the gaps into an email or a query to a colleague; the Copy the list button copies it.
- If one gap is enormous, look at the number on its far side first. A single mistyped value, such as INV-10010 among INV-1001 to INV-1009, creates thousands of false missing numbers.
Common pitfalls
Gaps are only searched for between the lowest and highest number in each series. If invoices before the first one in your file were lost, or the last ones were never exported, nothing in the file shows it; check the lowest and highest numbers against the previous period's register.
A missing number is not proof of a missing document. Many accounting programs skip a number when a draft is deleted, and some reserve blocks of numbers. Treat the report as a list of questions, not of errors.
Row numbers count data rows, so row 1 is the first row under the header. To find a row in a spreadsheet whose header sits in row 1, add 1; when the header sits lower down, the page says which row it is.
The out-of-order check compares each entry with the one listed just above it in the same series. A register sorted by customer or by amount will show many entries as out of order; sort it by number or by date first if that check is to mean anything.
Columns separated by semicolons or tabs are not split by the CSV reader. The page recognises a header with no commas and asks for a comma-separated or .xlsx copy.
Common errors and how to fix them
- "This file separates its columns with semicolons or tabs, so it reads as one column."
- Spreadsheet apps set to a European locale often save CSV with semicolons. Save the register as .xlsx, or export it as comma-separated CSV, and load it again.
- "No value in this column ends in a number."
- The page guessed the wrong column, often a customer name or a status. Pick the column that holds the invoice or cheque numbers from the menu.
- Loading stops because the register is an old-format .xls workbook or is password-protected.
- Open it in your spreadsheet app, remove any password, save it as .xlsx and choose the new file.
- Every invoice shows up under Date goes back, or none of the dates are read.
- Check the day and month order shown under the date column. With 03/04/2026 style dates the page can only tell the order from a day above 12; if every date in the file has a day of 12 or less, choose the order yourself.
Best practices
- Run the check on a full period's export, from the first number of the period to the last, rather than on a filtered view.
- Write the reason next to each gap in the downloaded report, such as "draft deleted" or "voided, paper copy filed", and keep it with the period's records.
- Correct duplicates at the source by issuing a credit note or a new number, rather than editing the export.
- Repeat the check after fixing problems, to confirm the report comes back with no missing or duplicated numbers.
How series and prefixes are decided
The prefix is everything before the final run of digits, so INV-2026-0042 has the prefix INV-2026- and a register that restarts its numbering each year is checked year by year. Prefixes are compared ignoring upper and lower case and spaces: CHK 2045, chk2046 and Chk 2047 belong to one series. A dash is not ignored, so INV-1001 and INV1001 are two series; if that is an inconsistency in your data, turn the series option off and the numbers are checked together.
Missing numbers take the prefix and padding of the existing number just below the gap. When one series mixes padded and unpadded values, such as INV-099 and INV-1001, the padding never shortens a number; zeros are only added to reach the width of that lower neighbour.
What the downloaded report contains
The CSV has one row per finding with the columns Check, Series, Value, Through, Count, Data rows and Detail, so it can be filtered by type in a spreadsheet. It starts with a summary row per series, then the missing ranges, then the missing numbers one per row up to 10,000, then duplicates, values not read, empty cells, out-of-order entries, dates that go back and dates that could not be read.
Values beginning with =, +, @ or a tab are written with a leading apostrophe so that a spreadsheet shows them as text instead of running them as formulas. A UTF-8 byte-order mark opens the file and each line ends in CR LF; the mark is what lets Excel show prefixes with accented letters correctly.
Frequently asked questions
Does it matter which order the rows are in?
Not for gaps or duplicates, which are found from the numbers alone. Order matters only for the out-of-order list, which describes the file as it is, and the date check, which follows the numbers rather than the rows.
Can it check numbers that contain letters in the middle, like 2026-A-0042?
Yes, as long as the value ends in digits. The prefix is 2026-A- and the number is 42. A value that ends in letters, such as 0042-A, is listed as not read.
Why is a number with leading zeros the same as one without?
INV-0042 and INV-42 are both the number 42 in the INV- series, so if both appear they are reported as a duplicate, with both spellings shown, because a reader would treat them as the same invoice.
Can I check a register whose numbers restart at 1 every year?
Only if the year is part of the number. With 2025-0001 and 2026-0001 the prefixes differ, so each year is its own series. With plain numbers that restart, 1 to 450 from one year and 1 to 380 from the next fall into one series and show up as duplicates; filter the export to one year at a time and check each part.